@Override public void previewWatermark(Graphics g, SubstanceSkin skin, int x, int y, int width, int height) { this .drawWatermarkImage(skin, (Graphics2D) g, x, y, width, height, true); }
@Override public void previewWatermark(Graphics g, SubstanceSkin skin, int x, int y, int width, int height) { this .drawWatermarkImage(skin, (Graphics2D) g, x, y, width, height, true); }
@Override public String getDisplayName() { return SubstanceCrosshatchWatermark.getName(); }
/** * Sets image watermark kind. * * @param kind * Image watermark kind. */ public void setKind(ImageWatermarkKind kind) { if (kind == null) { throw new IllegalArgumentException( "Can't pass null to SubstanceImageWatermark.setKind()"); } this.kind = kind; this.updateWatermarkImage(SubstanceLookAndFeel.getCurrentSkin(null)); }
/** * Returns an icon that matches the specified watermark. * * @param watermark * Watermark instance. * @return Icon that matches the specified watermark. */ public static Icon getWatermarkIcon(SubstanceWatermark watermark) { int iSize = SubstanceSizeUtils.getTitlePaneIconSize(); BufferedImage result = SubstanceCoreUtilities.getBlankImage(iSize, iSize); Graphics2D graphics = (Graphics2D) result.getGraphics().create(); graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); watermark .previewWatermark(graphics, SubstanceColorSchemeUtilities.METALLIC_SKIN, 0, 0, iSize, iSize); graphics.dispose(); return new ImageIcon(result); }
switch (getKind()) { case SCREEN_CENTER_SCALE: case SCREEN_TILE:
@Override public void uninitialize() { super.uninitialize(); SubstanceLookAndFeel.currentSkin = null; ShadowPopupFactory.uninstall(); SubstanceCoreUtilities.stopThreads(); // fix for defect 109 - memory leak on watermarks if (this.skin.getWatermark() != null) this.skin.getWatermark().dispose(); // uninitialize component plugins SubstanceLookAndFeel.componentPlugins.uninitializeAll(); // reset widget support LafWidgetRepository.getRepository().unsetLafSupport(); // clear caches LazyResettableHashMap.reset(); this.currentKeyboardFocusManager .removePropertyChangeListener(this.focusOwnerChangeListener); this.focusOwnerChangeListener = null; this.currentKeyboardFocusManager = null; }
@Override public void previewWatermark(Graphics g, SubstanceSkin skin, int x, int y, int width, int height) { this .drawWatermarkImage(skin, (Graphics2D) g, x, y, width, height, true); }
/** * Sets image watermark kind. * * @param kind * Image watermark kind. */ public void setKind(ImageWatermarkKind kind) { if (kind == null) { throw new IllegalArgumentException( "Can't pass null to SubstanceImageWatermark.setKind()"); } this.kind = kind; this.updateWatermarkImage(SubstanceLookAndFeel.getCurrentSkin(null)); }
@Override public void previewWatermark(Graphics g, SubstanceSkin skin, int x, int y, int width, int height) { this .drawWatermarkImage(skin, (Graphics2D) g, x, y, width, height, true); }
@Override public String getDisplayName() { return SubstanceCrosshatchWatermark.getName(); }
/** * Returns an icon that matches the specified watermark. * * @param watermark * Watermark instance. * @return Icon that matches the specified watermark. */ public static Icon getWatermarkIcon(SubstanceWatermark watermark) { int iSize = SubstanceSizeUtils.getTitlePaneIconSize(); BufferedImage result = SubstanceCoreUtilities.getBlankImage(iSize, iSize); Graphics2D graphics = (Graphics2D) result.getGraphics().create(); graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); watermark .previewWatermark(graphics, SubstanceColorSchemeUtilities.METALLIC_SKIN, 0, 0, iSize, iSize); graphics.dispose(); return new ImageIcon(result); }
switch (getKind()) { case SCREEN_CENTER_SCALE: case SCREEN_TILE:
@Override public void uninitialize() { super.uninitialize(); SubstanceLookAndFeel.currentSkin = null; ShadowPopupFactory.uninstall(); SubstanceCoreUtilities.stopThreads(); // fix for defect 109 - memory leak on watermarks if (this.skin.getWatermark() != null) this.skin.getWatermark().dispose(); // uninitialize component plugins SubstanceLookAndFeel.componentPlugins.uninitializeAll(); // reset widget support LafWidgetRepository.getRepository().unsetLafSupport(); // clear caches LazyResettableHashMap.reset(); this.currentKeyboardFocusManager .removePropertyChangeListener(this.focusOwnerChangeListener); this.focusOwnerChangeListener = null; this.currentKeyboardFocusManager = null; }
@Override public boolean updateWatermarkImage(SubstanceSkin skin) { // fix by Chris for bug 67 - support for multiple screens Rectangle virtualBounds = new Rectangle(); GraphicsEnvironment ge = GraphicsEnvironment .getLocalGraphicsEnvironment(); GraphicsDevice[] gds = ge.getScreenDevices(); for (GraphicsDevice gd : gds) { GraphicsConfiguration gc = gd.getDefaultConfiguration(); virtualBounds = virtualBounds.union(gc.getBounds()); } int screenWidth = virtualBounds.width; int screenHeight = virtualBounds.height; SubstanceStripeWatermark.watermarkImage = SubstanceCoreUtilities .getBlankImage(screenWidth, screenHeight); Graphics2D graphics = (Graphics2D) SubstanceStripeWatermark.watermarkImage .getGraphics().create(); boolean status = this.drawWatermarkImage(skin, graphics, 0, 0, screenWidth, screenHeight, false); graphics.dispose(); return status; }
/** * Sets image watermark opacity. * * @param opacity * Image watermark opacity. * @throws IllegalArgumentException * if the argument is not in 0.0-1.0 range. */ public void setOpacity(float opacity) { if ((opacity < 0.0f) || (opacity > 1.0f)) { throw new IllegalArgumentException( "SubstanceImageWatermark.setOpacity() can get value in 0.0-1.0 range, was passed value " + opacity); } this.opacity = opacity; this.updateWatermarkImage(SubstanceLookAndFeel.getCurrentSkin(null)); } }
public boolean updateWatermarkImage(SubstanceSkin skin) { // fix by Chris for bug 67 - support for multiple screens Rectangle virtualBounds = new Rectangle(); GraphicsEnvironment ge = GraphicsEnvironment .getLocalGraphicsEnvironment(); GraphicsDevice[] gds = ge.getScreenDevices(); for (GraphicsDevice gd : gds) { GraphicsConfiguration gc = gd.getDefaultConfiguration(); virtualBounds = virtualBounds.union(gc.getBounds()); } int screenWidth = virtualBounds.width; int screenHeight = virtualBounds.height; SubstanceCrosshatchWatermark.watermarkImage = SubstanceCoreUtilities .getBlankImage(screenWidth, screenHeight); Graphics2D graphics = (Graphics2D) SubstanceCrosshatchWatermark.watermarkImage .getGraphics().create(); boolean status = this.drawWatermarkImage(skin, graphics, 0, 0, screenWidth, screenHeight, false); graphics.dispose(); return status; }
public String getDisplayName() { return SubstanceCrosshatchWatermark.getName(); }
public boolean updateWatermarkImage(SubstanceSkin skin) { // fix by Chris for bug 67 - support for multiple screens Rectangle virtualBounds = new Rectangle(); GraphicsEnvironment ge = GraphicsEnvironment .getLocalGraphicsEnvironment(); GraphicsDevice[] gds = ge.getScreenDevices(); for (GraphicsDevice gd : gds) { GraphicsConfiguration gc = gd.getDefaultConfiguration(); virtualBounds = virtualBounds.union(gc.getBounds()); } int screenWidth = virtualBounds.width; int screenHeight = virtualBounds.height; SubstanceStripeWatermark.watermarkImage = SubstanceCoreUtilities .getBlankImage(screenWidth, screenHeight); Graphics2D graphics = (Graphics2D) SubstanceStripeWatermark.watermarkImage .getGraphics().create(); boolean status = this.drawWatermarkImage(skin, graphics, 0, 0, screenWidth, screenHeight, false); graphics.dispose(); return status; }
/** * Sets image watermark opacity. * * @param opacity * Image watermark opacity. * @throws IllegalArgumentException * if the argument is not in 0.0-1.0 range. */ public void setOpacity(float opacity) { if ((opacity < 0.0f) || (opacity > 1.0f)) { throw new IllegalArgumentException( "SubstanceImageWatermark.setOpacity() can get value in 0.0-1.0 range, was passed value " + opacity); } this.opacity = opacity; this.updateWatermarkImage(SubstanceLookAndFeel.getCurrentSkin(null)); } }