/** * Returns the default icon size that is used in menus, menu items and * toolbars. Menu items that have no icon set are aligned using the default * icon dimensions. * * @return the dimension of the default icon * @see #setDefaultIconSize(Dimension) */ public static Dimension getDefaultIconSize() { Dimension size = UIManager.getDimension(DEFAULT_ICON_SIZE_KEY); return size == null ? DEFAULT_ICON_SIZE : size; }
/** * Returns the default icon size that is used in menus, menu items and * toolbars. Menu items that have no icon set are aligned using the default * icon dimensions. * * @return the dimension of the default icon * @see #setDefaultIconSize(Dimension) */ public static Dimension getDefaultIconSize() { Dimension size = UIManager.getDimension(DEFAULT_ICON_SIZE_KEY); return size == null ? DEFAULT_ICON_SIZE : size; }
/** * Returns the default icon size that is used in menus, menu items and * toolbars. Menu items that have no icon set are aligned using the default * icon dimensions. * * @return the dimension of the default icon * * @see #setDefaultIconSize(Dimension) */ public static Dimension getDefaultIconSize() { Dimension size = UIManager.getDimension(DEFAULT_ICON_SIZE_KEY); return size == null ? DEFAULT_ICON_SIZE : size; }
protected void initValues() { defaultSwatchSize = UIManager.getDimension("ColorChooser.swatchesSwatchSize"); swatchSize.width = defaultSwatchSize.width; swatchSize.height = defaultSwatchSize.height; gap = new Dimension(1, 1); }
protected void initValues() { defaultSwatchSize = UIManager.getDimension("ColorChooser.swatchesSwatchSize"); swatchSize.width = defaultSwatchSize.width; swatchSize.height = defaultSwatchSize.height; gap = new Dimension(1, 1); }
public RecentSwatchPanel() { Color default_color = UIManager.getColor("ColorChooser.swatchesDefaultRecentColor"); if (default_color == null) default_color = UIManager.getColor("control"); if (default_color == null) default_color = Color.gray; m_default_color = new ColorHolder(default_color); m_colors = RecentColorsModel.createInstance(SWATCH_ROWS * SWATCH_COLUMNS); m_swatch_size = UIManager.getDimension("ColorChooser.swatchesRecentSwatchSize"); if (m_swatch_size == null) m_swatch_size = new Dimension(10, 10); m_gap = new Dimension(1, 1); setToolTipText(""); setRequestFocusEnabled(false); setBorder(javax.swing.BorderFactory.createLineBorder(Color.black)); }
/** * 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; }