@Override protected void paintBackground(Graphics2D g, JXStatusBar statusBar) { if (leftImage == null || middleImage == null || rightImage == null) { log.severe("Failed to initialize necessary assets. Set logging to FINE to see more details."); return; } //if bidi, reverse the image painting order //TODO need to handle vertical stretching better g.drawImage(leftImage, 0, 0, leftImage.getWidth(), statusBar.getHeight(), null); if (statusBar.isResizeHandleEnabled()) { g.drawImage(middleImage, leftImage.getWidth(), 0, statusBar.getWidth() - leftImage.getWidth() - rightImage.getWidth(), statusBar.getHeight(), null); g.drawImage(rightImage, statusBar.getWidth() - rightImage.getWidth(), 0, rightImage.getWidth(), statusBar.getHeight(), null); } else { g.drawImage(middleImage, leftImage.getWidth(), 0, statusBar.getWidth() - leftImage.getWidth(), statusBar.getHeight(), null); } }
@Override protected void paintBackground(Graphics2D g, JXStatusBar statusBar) { if (leftImage == null || middleImage == null || rightImage == null) { log.severe("Failed to initialize necessary assets. Set logging to FINE to see more details."); return; } //if bidi, reverse the image painting order //TODO need to handle vertical stretching better g.drawImage(leftImage, 0, 0, leftImage.getWidth(), statusBar.getHeight(), null); if (statusBar.isResizeHandleEnabled()) { g.drawImage(middleImage, leftImage.getWidth(), 0, statusBar.getWidth() - leftImage.getWidth() - rightImage.getWidth(), statusBar.getHeight(), null); g.drawImage(rightImage, statusBar.getWidth() - rightImage.getWidth(), 0, rightImage.getWidth(), statusBar.getHeight(), null); } else { g.drawImage(middleImage, leftImage.getWidth(), 0, statusBar.getWidth() - leftImage.getWidth(), statusBar.getHeight(), null); } }
@Override protected void paintBackground(Graphics2D g, JXStatusBar statusBar) { if (leftImage == null || middleImage == null || rightImage == null) { log.severe("Failed to initialize necessary assets. Set logging to FINE to see more details."); return; } //if bidi, reverse the image painting order //TODO need to handle vertical stretching better g.drawImage(leftImage, 0, 0, leftImage.getWidth(), statusBar.getHeight(), null); if (statusBar.isResizeHandleEnabled()) { g.drawImage(middleImage, leftImage.getWidth(), 0, statusBar.getWidth() - leftImage.getWidth() - rightImage.getWidth(), statusBar.getHeight(), null); g.drawImage(rightImage, statusBar.getWidth() - rightImage.getWidth(), 0, rightImage.getWidth(), statusBar.getHeight(), null); } else { g.drawImage(middleImage, leftImage.getWidth(), 0, statusBar.getWidth() - leftImage.getWidth(), statusBar.getHeight(), null); } }
@Override protected void paintBackground(Graphics2D g, JXStatusBar statusBar) { if (leftImage == null || middleImage == null || rightImage == null) { log.severe("Failed to initialize necessary assets. Set logging to FINE to see more details."); return; } //if bidi, reverse the image painting order //TODO need to handle vertical stretching better g.drawImage(leftImage, 0, 0, leftImage.getWidth(), statusBar.getHeight(), null); if (statusBar.isResizeHandleEnabled()) { g.drawImage(middleImage, leftImage.getWidth(), 0, statusBar.getWidth() - leftImage.getWidth() - rightImage.getWidth(), statusBar.getHeight(), null); g.drawImage(rightImage, statusBar.getWidth() - rightImage.getWidth(), 0, rightImage.getWidth(), statusBar.getHeight(), null); } else { g.drawImage(middleImage, leftImage.getWidth(), 0, statusBar.getWidth() - leftImage.getWidth(), statusBar.getHeight(), null); } }
@Override protected void paintBackground(Graphics2D g, JXStatusBar statusBar) { if (leftImage == null || middleImage == null || rightImage == null) { log.severe("Failed to initialize necessary assets. Set logging to FINE to see more details."); return; } //if bidi, reverse the image painting order //TODO need to handle vertical stretching better g.drawImage(leftImage, 0, 0, leftImage.getWidth(), statusBar.getHeight(), null); if (statusBar.isResizeHandleEnabled()) { g.drawImage(middleImage, leftImage.getWidth(), 0, statusBar.getWidth() - leftImage.getWidth() - rightImage.getWidth(), statusBar.getHeight(), null); g.drawImage(rightImage, statusBar.getWidth() - rightImage.getWidth(), 0, rightImage.getWidth(), statusBar.getHeight(), null); } else { g.drawImage(middleImage, leftImage.getWidth(), 0, statusBar.getWidth() - leftImage.getWidth(), statusBar.getHeight(), null); } }
protected void paintBackground(Graphics2D g, JXStatusBar bar) { if (bar.isOpaque()) { g.setColor(bar.getBackground()); g.fillRect(0, 0, bar.getWidth(), bar.getHeight()); } }
@Override protected void paintBackground(Graphics2D g, JXStatusBar bar) { int w = bar.getWidth(); //TODO deal with insets int h = bar.getHeight(); //TODO deal with insets
protected void paintBackground(Graphics2D g, JXStatusBar bar) { if (bar.isOpaque()) { g.setColor(bar.getBackground()); g.fillRect(0, 0, bar.getWidth(), bar.getHeight()); } }
@Override protected void paintBackground(Graphics2D g, JXStatusBar bar) { int w = bar.getWidth(); //TODO deal with insets int h = bar.getHeight(); //TODO deal with insets
@Override protected void paintBackground(Graphics2D g, JXStatusBar bar) { int w = bar.getWidth(); //TODO deal with insets int h = bar.getHeight(); //TODO deal with insets
@Override protected void paintBackground(Graphics2D g, JXStatusBar bar) { int w = bar.getWidth(); //TODO deal with insets int h = bar.getHeight(); //TODO deal with insets
protected void paintBackground(Graphics2D g, JXStatusBar bar) { if (bar.isOpaque()) { g.setColor(bar.getBackground()); g.fillRect(0, 0, bar.getWidth(), bar.getHeight()); } }
protected void paintBackground(Graphics2D g, JXStatusBar bar) { if (bar.isOpaque()) { g.setColor(bar.getBackground()); g.fillRect(0, 0, bar.getWidth(), bar.getHeight()); } }
protected void paintBackground(Graphics2D g, JXStatusBar bar) { if (bar.isOpaque()) { g.setColor(bar.getBackground()); g.fillRect(0, 0, bar.getWidth(), bar.getHeight()); } }
@Override protected void paintBackground(Graphics2D g, JXStatusBar bar) { g.setColor(bar.getBackground()); g.fillRect(0, 0, bar.getWidth(), bar.getHeight()); //paint an inset border around each component. This suggests that //there is an extra border around the status bar...! Border b = BorderFactory.createBevelBorder(BevelBorder.LOWERED, Color.WHITE, bar.getBackground(), bar.getBackground(), Color.GRAY); Insets insets = new Insets(0, 0, 0, 0); for (Component c : bar.getComponents()) { getSeparatorInsets(insets); int x = c.getX() - insets.right; int y = c.getY() - 2; int w = c.getWidth() + insets.left + insets.right; int h = c.getHeight() + 4; b.paintBorder(c, g, x, y, w, h); } }
@Override protected void paintBackground(Graphics2D g, JXStatusBar bar) { g.setColor(bar.getBackground()); g.fillRect(0, 0, bar.getWidth(), bar.getHeight()); //paint an inset border around each component. This suggests that //there is an extra border around the status bar...! Border b = BorderFactory.createBevelBorder(BevelBorder.LOWERED, Color.WHITE, bar.getBackground(), bar.getBackground(), Color.GRAY); Insets insets = new Insets(0, 0, 0, 0); for (Component c : bar.getComponents()) { getSeparatorInsets(insets); int x = c.getX() - insets.right; int y = c.getY() - 2; int w = c.getWidth() + insets.left + insets.right; int h = c.getHeight() + 4; b.paintBorder(c, g, x, y, w, h); } }
@Override protected void paintBackground(Graphics2D g, JXStatusBar bar) { g.setColor(bar.getBackground()); g.fillRect(0, 0, bar.getWidth(), bar.getHeight()); //paint an inset border around each component. This suggests that //there is an extra border around the status bar...! Border b = BorderFactory.createBevelBorder(BevelBorder.LOWERED, Color.WHITE, bar.getBackground(), bar.getBackground(), Color.GRAY); Insets insets = new Insets(0, 0, 0, 0); for (Component c : bar.getComponents()) { getSeparatorInsets(insets); int x = c.getX() - insets.right; int y = c.getY() - 2; int w = c.getWidth() + insets.left + insets.right; int h = c.getHeight() + 4; b.paintBorder(c, g, x, y, w, h); } }
@Override protected void paintBackground(Graphics2D g, JXStatusBar bar) { g.setColor(bar.getBackground()); g.fillRect(0, 0, bar.getWidth(), bar.getHeight()); //paint an inset border around each component. This suggests that //there is an extra border around the status bar...! Border b = BorderFactory.createBevelBorder(BevelBorder.LOWERED, Color.WHITE, bar.getBackground(), bar.getBackground(), Color.GRAY); Insets insets = new Insets(0, 0, 0, 0); for (Component c : bar.getComponents()) { getSeparatorInsets(insets); int x = c.getX() - insets.right; int y = c.getY() - 2; int w = c.getWidth() + insets.left + insets.right; int h = c.getHeight() + 4; b.paintBorder(c, g, x, y, w, h); } }
@Override protected void paintBackground(Graphics2D g, JXStatusBar bar) { g.setColor(bar.getBackground()); g.fillRect(0, 0, bar.getWidth(), bar.getHeight()); //paint an inset border around each component. This suggests that //there is an extra border around the status bar...! Border b = BorderFactory.createBevelBorder(BevelBorder.LOWERED, Color.WHITE, bar.getBackground(), bar.getBackground(), Color.GRAY); Insets insets = new Insets(0, 0, 0, 0); for (Component c : bar.getComponents()) { getSeparatorInsets(insets); int x = c.getX() - insets.right; int y = c.getY() - 2; int w = c.getWidth() + insets.left + insets.right; int h = c.getHeight() + 4; b.paintBorder(c, g, x, y, w, h); } }
@Override protected void paintBackground(Graphics2D g, JXStatusBar bar) { this.bgDelegate.paint(bar, g, true); JRootPane rootPane = SwingUtilities.getRootPane(bar); Window window = SwingUtilities.getWindowAncestor(bar); boolean isResizable = false; if (window instanceof JFrame) { JFrame frame = (JFrame) window; isResizable = frame.isResizable() && (frame.getExtendedState() != JFrame.MAXIMIZED_BOTH); } if (window instanceof JDialog) { isResizable = ((JDialog) window).isResizable(); } boolean hasResizeGrip = SubstanceCoreUtilities .toShowExtraWidgets(rootPane) && isResizable; if (hasResizeGrip) { int dim = bar.getHeight() * 2 / 3; SubstanceColorScheme scheme = SubstanceColorSchemeUtilities .getColorScheme(bar, ColorSchemeAssociationKind.SEPARATOR, ComponentState.ENABLED); BufferedImage resizeImage = SubstanceImageCreator .getResizeGripImage(bar, scheme, dim, false); g.drawImage(resizeImage, bar.getWidth() - dim, bar.getHeight() - dim, null); } }