d.put("ScrollBar.maximumThumbSize", new DimensionUIResource(1000, 1000));
private static void installLookAndFeel(final String className) { //noinspection OverlyBroadCatchBlock try { Class<?> lnfClass = Class.forName(className, true, Thread.currentThread().getContextClassLoader()); final LookAndFeel lAndF; lAndF = (LookAndFeel) lnfClass.getConstructor().newInstance(); // Reset the defaults after instantiating, but before // calling UIManager.setLookAndFeel(). This fixes the Nimbus bug DimensionUIResource dim = new DimensionUIResource(4096, 4096); lAndF.getDefaults().put("ScrollBar.maximumThumbSize", dim); UIManager.setLookAndFeel(lAndF); } catch (Exception e) { final String systemName = UIManager.getSystemLookAndFeelClassName(); // Prevents an infinite recursion that's not very likely... // (I like to code defensively) if (!className.equals(systemName)) { installLookAndFeel(systemName); } else { // Feel free to handle this any other way. //noinspection ProhibitedExceptionThrown throw new RuntimeException(e); } } }
/** * Returns a dimension from the defaults. If the value for {@code key} is * not a {@code Dimension}, {@code defaultDimension} is returned. * * @param key * an {@code Object} specifying the dimension * @param defaultDimension * the dimension to return if the dimension specified by * {@code key} does not exist * @return the {@code Dimension} object * @throws NullPointerException * if {@code key} or {@code defaultColor} is {@code null} */ public static Dimension getSafeDimension(Object key, Dimension defaultDimension) { Contract.asNotNull(defaultDimension, "defaultDimension cannot be null"); Dimension safeDimension = UIManager.getDimension(key); if (safeDimension == null) { safeDimension = defaultDimension; } if (!(safeDimension instanceof UIResource)) { safeDimension = new DimensionUIResource(safeDimension.width, safeDimension.height); } return safeDimension; }
/** * Returns a dimension from the defaults. If the value for {@code key} is * not a {@code Dimension}, {@code defaultDimension} is returned. * * @param key * an {@code Object} specifying the dimension * @param defaultDimension * the dimension to return if the dimension specified by * {@code key} does not exist * @return the {@code Dimension} object * @throws NullPointerException * if {@code key} or {@code defaultColor} is {@code null} */ public static Dimension getSafeDimension(Object key, Dimension defaultDimension) { Contract.asNotNull(defaultDimension, "defaultDimension cannot be null"); Dimension safeDimension = UIManager.getDimension(key); if (safeDimension == null) { safeDimension = defaultDimension; } if (!(safeDimension instanceof UIResource)) { safeDimension = new DimensionUIResource(safeDimension.width, safeDimension.height); } return safeDimension; }
/** * Returns a dimension from the defaults. If the value for {@code key} is * not a {@code Dimension}, {@code defaultDimension} is returned. * * @param key * an {@code Object} specifying the dimension * @param defaultDimension * the dimension to return if the dimension specified by * {@code key} does not exist * @return the {@code Dimension} object * @throws NullPointerException * if {@code key} or {@code defaultColor} is {@code null} */ public static Dimension getSafeDimension(Object key, Dimension defaultDimension) { Contract.asNotNull(defaultDimension, "defaultDimension cannot be null"); Dimension safeDimension = UIManager.getDimension(key); if (safeDimension == null) { safeDimension = defaultDimension; } if (!(safeDimension instanceof UIResource)) { safeDimension = new DimensionUIResource(safeDimension.width, safeDimension.height); } return safeDimension; }
/** * Returns a dimension from the defaults. If the value for {@code key} is * not a {@code Dimension}, {@code defaultDimension} is returned. * * @param key * an {@code Object} specifying the dimension * @param defaultDimension * the dimension to return if the dimension specified by * {@code key} does not exist * @return the {@code Dimension} object * @throws NullPointerException * if {@code key} or {@code defaultColor} is {@code null} */ public static Dimension getSafeDimension(Object key, Dimension defaultDimension) { Contract.asNotNull(defaultDimension, "defaultDimension cannot be null"); Dimension safeDimension = UIManager.getDimension(key); if (safeDimension == null) { safeDimension = defaultDimension; } if (!(safeDimension instanceof UIResource)) { safeDimension = new DimensionUIResource(safeDimension.width, safeDimension.height); } return safeDimension; }
private final void handleDim (org.xml.sax.AttributeList atts) throws SAXException { String key = atts.getValue (KEY_ATTR); int width = intFromAttr (atts, WIDTH_ATTR); int height = intFromAttr (atts, HEIGHT_ATTR); DimensionUIResource resource = new DimensionUIResource (width, height); defaults.put (key, resource); }
UIManager.put( element.getProperty("NAME"), new DimensionUIResource(dim.width, dim.height)); } else if ( "LineBorder".equalsIgnoreCase(type)
new DimensionUIResource(5, 5), "ColorChooser.resetMnemonic", new Integer(-1),
"Slider.horizontalSize", new DimensionUIResource(100, 20), "Slider.verticalSize", new DimensionUIResource(20, 100), "Slider.northThumb.small", new UIDefaults.ProxyLazyValue( "org.jhotdraw.gui.plaf.palette.PaletteSliderThumbIcon",
new DimensionUIResource(5, 5), "ColorChooser.resetMnemonic", -1,
/** * DOCUMENT ME! * * @param sep DOCUMENT ME! */ private void updateStyle(JSeparator sep) { SeaGlassContext context = getContext(sep, ENABLED); SynthStyle oldStyle = style; style = SeaGlassLookAndFeel.updateStyle(context, this); if (style != oldStyle) { if (sep instanceof JToolBar.Separator) { Dimension size = ((JToolBar.Separator) sep).getSeparatorSize(); if (size == null || size instanceof UIResource) { size = (DimensionUIResource) style.get(context, "ToolBar.separatorSize"); if (true || size == null) { size = new DimensionUIResource(10, 10); } ((JToolBar.Separator) sep).setSeparatorSize(size); } } } context.dispose(); }
d.put("InternalFrameTitlePane.maxFrameIconSize", new DimensionUIResource(18, 18));
d.put("ProgressBar.paintOutsideClip", Boolean.TRUE); d.put("ProgressBar.rotateText", Boolean.TRUE); d.put("ProgressBar.vertictalSize", new DimensionUIResource(19, 150)); d.put("ProgressBar.horizontalSize", new DimensionUIResource(150, 19)); addColor(d, "ProgressBar[Disabled].textForeground", "seaGlassDisabledText", 0.0f, 0.0f, 0.0f, 0); d.put("ProgressBar[Disabled+Indeterminate].progressPadding", new Integer(3));
"CommandBar.titleBarForeground", activeTitleTextColor, "CommandBar.titleBarFont", boldFont, "CommandBar.minimumSize", new DimensionUIResource(20, 20), "CommandBar.separatorSize", new DimensionUIResource(5, 20),
"CommandBar.titleBarForeground", defaultTextColor, "CommandBar.titleBarFont", boldFont, "CommandBar.minimumSize", new DimensionUIResource(20, 20),
d.put(p + ".contentMargins", new InsetsUIResource(0, 0, 0, 0)); d.put(p + ".opaque", Boolean.TRUE); d.put(p + ".intercellSpacing", new DimensionUIResource(0, 0)); d.put(p + ".rendererUseTableColors", Boolean.TRUE); d.put(p + ".rendererUseUIBorder", Boolean.TRUE);
"CommandBar.titleBarForeground", activeTitleTextColor, "CommandBar.titleBarFont", controlFont, "CommandBar.minimumSize", new DimensionUIResource(16, 16),
d.put("ScrollBar.contentMargins", new InsetsUIResource(0, 0, 0, 0)); d.put("ScrollBar.thumbHeight", new Integer(15)); d.put("ScrollBar.minimumThumbSize", new DimensionUIResource(29, 29)); d.put("ScrollBar.maximumThumbSize", new DimensionUIResource(1000, 1000));
new DimensionUIResource(146, SubstanceSizeUtils .getControlFontSize()), new DimensionUIResource( SubstanceSizeUtils.getControlFontSize(), 146), new DimensionUIResource(SubstanceSizeUtils .getScrollBarWidth(SubstanceSizeUtils .getControlFontSize()) - 2, SubstanceSizeUtils