Java Code Examples for java.awt.Component#isOpaque()
The following examples show how to use
java.awt.Component#isOpaque() .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: littleluck File: LuckTableCellHeaderRenderer.java License: Apache License 2.0 | 6 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. */ public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JTable. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 2
Source Project: hottub File: DefaultTableCellRenderer.java License: GNU General Public License v2.0 | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. */ public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JTable. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 3
Source Project: jdk8u-dev-jdk File: DefaultTableCellRenderer.java License: GNU General Public License v2.0 | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. */ public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JTable. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 4
Source Project: dragonwell8_jdk File: DefaultTableCellRenderer.java License: GNU General Public License v2.0 | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. */ public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JTable. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 5
Source Project: dragonwell8_jdk File: DefaultListCellRenderer.java License: GNU General Public License v2.0 | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. * * @since 1.5 * @return <code>true</code> if the background is completely opaque * and differs from the JList's background; * <code>false</code> otherwise */ @Override public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JList. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 6
Source Project: openjdk-8 File: DefaultTableCellRenderer.java License: GNU General Public License v2.0 | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. */ public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JTable. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 7
Source Project: Java8CN File: DefaultListCellRenderer.java License: Apache License 2.0 | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. * * @since 1.5 * @return <code>true</code> if the background is completely opaque * and differs from the JList's background; * <code>false</code> otherwise */ @Override public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JList. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 8
Source Project: jdk8u60 File: DefaultTableCellRenderer.java License: GNU General Public License v2.0 | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. */ public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JTable. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 9
Source Project: jdk8u_jdk File: DefaultListCellRenderer.java License: GNU General Public License v2.0 | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. * * @since 1.5 * @return <code>true</code> if the background is completely opaque * and differs from the JList's background; * <code>false</code> otherwise */ @Override public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JList. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 10
Source Project: JDKSourceCode1.8 File: DefaultTableCellRenderer.java License: MIT License | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. */ public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JTable. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 11
Source Project: JDKSourceCode1.8 File: DefaultListCellRenderer.java License: MIT License | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. * * @since 1.5 * @return <code>true</code> if the background is completely opaque * and differs from the JList's background; * <code>false</code> otherwise */ @Override public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JList. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 12
Source Project: pumpernickel File: DecoratedTreeUI.java License: MIT License | 5 votes |
/** * This is copied from BasicTreeUI.java. The only modifications are: * <ul> * <li>The background color is painted across the entire width of the tree.</li> * <li>Because of the above requirement: the expand control is redundantly * painted on top of that rectangle for visibility.</li> * <li>We never inform the CellRenderer whether focus is present. (That * argument is left false, because we don't have access to private fields * the original logic wanted.)</li> * </ul> */ @Override protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { // Don't paint the renderer if editing this row. if (editingComponent != null && editingRow == row) return; // this is in BasicTreeUI, but getLeadSelectionRow() is private. /* * int leadIndex; * * if(tree.hasFocus()) { leadIndex = getLeadSelectionRow(); } else * leadIndex = -1; */ Component component; component = currentCellRenderer.getTreeCellRendererComponent(tree, path.getLastPathComponent(), tree.isRowSelected(row), isExpanded, isLeaf, row, false); if (component.isOpaque()) { Color bkgnd = component.getBackground(); g.setColor(bkgnd); g.fillRect(0, bounds.y, tree.getWidth(), bounds.height); if (shouldPaintExpandControl(path, row, isExpanded, hasBeenExpanded, isLeaf)) { paintExpandControl(g, bounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf); } } rendererPane.paintComponent(g, component, tree, bounds.x, bounds.y, bounds.width, bounds.height, true); }
Example 13
Source Project: openjdk-jdk9 File: DefaultTableCellRenderer.java License: GNU General Public License v2.0 | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. */ public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JTable. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 14
Source Project: jdk8u-jdk File: DefaultTableCellRenderer.java License: GNU General Public License v2.0 | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. */ public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JTable. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 15
Source Project: jdk8u-jdk File: DefaultListCellRenderer.java License: GNU General Public License v2.0 | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. * * @since 1.5 * @return <code>true</code> if the background is completely opaque * and differs from the JList's background; * <code>false</code> otherwise */ @Override public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JList. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 16
Source Project: gate-core File: ResourceRenderer.java License: GNU Lesser General Public License v3.0 | 5 votes |
/** * Overridden for performance reasons. */ @Override public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if(p != null) { p = p.getParent(); } // p should now be the JTable. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 17
Source Project: jdk8u_jdk File: DefaultTableCellRenderer.java License: GNU General Public License v2.0 | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. */ public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JTable. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 18
Source Project: pcgen File: CompanionInfoTab.java License: GNU Lesser General Public License v2.1 | 5 votes |
@Override public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JTable. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 19
Source Project: openjdk-8-source File: DefaultListCellRenderer.java License: GNU General Public License v2.0 | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. * * @since 1.5 * @return <code>true</code> if the background is completely opaque * and differs from the JList's background; * <code>false</code> otherwise */ @Override public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JList. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }
Example 20
Source Project: jdk8u-dev-jdk File: DefaultListCellRenderer.java License: GNU General Public License v2.0 | 5 votes |
/** * Overridden for performance reasons. * See the <a href="#override">Implementation Note</a> * for more information. * * @since 1.5 * @return <code>true</code> if the background is completely opaque * and differs from the JList's background; * <code>false</code> otherwise */ @Override public boolean isOpaque() { Color back = getBackground(); Component p = getParent(); if (p != null) { p = p.getParent(); } // p should now be the JList. boolean colorMatch = (back != null) && (p != null) && back.equals(p.getBackground()) && p.isOpaque(); return !colorMatch && super.isOpaque(); }