public Object get(SynthContext context, Object key) { return style.get(context, key); }
trackThickness = style.getInt(context, "ProgressBar.trackThickness", 19); tileWidth = style.getInt(context, "ProgressBar.tileWidth", 15); bgFillColor = (Color) style.get(context, "ProgressBar.backgroundFillColor"); if (bgFillColor == null) { bgFillColor = Color.white;
linesStyle = style.get(context, "Tree.linesStyle"); value = style.get(context, "Tree.rowHeight"); if (value != null) { LookAndFeel.installProperty(tree, "rowHeight", value); value = style.get(context, "Tree.scrollsOnExpand"); LookAndFeel.installProperty(tree, "scrollsOnExpand", value != null ? value : Boolean.TRUE);
defaultTextIconGap = style.getInt(context, prefix + ".textIconGap", 4); if (menuItem.getMargin() == null || (menuItem.getMargin() instanceof UIResource)) { Insets insets = (Insets) style.get(context, prefix + ".margin");
dim = (Dimension) context.getStyle().get(context, "ScrollBar.buttonSize");
scrollBarWidth = style.getInt(context, "ScrollBar.thumbHeight", 14); minimumThumbSize = (Dimension) style.get(context, "ScrollBar.minimumThumbSize"); if (minimumThumbSize == null) { minimumThumbSize = new Dimension(); validMinimumThumbSize = true; maximumThumbSize = (Dimension) style.get(context, "ScrollBar.maximumThumbSize"); if (maximumThumbSize == null) { maximumThumbSize = new Dimension(4096, 4097);
/** * {@inheritDoc} */ @Override public Object get(SynthContext ctx, Object key) { return style.get(ctx, key); }
ViewportBorder(SeaGlassContext context) { this.insets = (Insets) context.getStyle().get(context, "ScrollPane.viewportBorderInsets"); if (this.insets == null) { this.insets = SeaGlassLookAndFeel.EMPTY_UIRESOURCE_INSETS; } }
/** * @inheritDoc */ @Override protected void paintDropLine(Graphics g) { JTree.DropLocation loc = tree.getDropLocation(); if (!isDropLine(loc)) { return; } Color c = (Color) style.get(paintContext, "Tree.dropLineColor"); if (c != null) { g.setColor(c); Rectangle rect = getDropLineRect(loc); g.fillRect(rect.x, rect.y, rect.width, rect.height); } }
/** * Create the layout manager for the title pane. * * @return the layout manager. */ private LayoutManager createLayout() { SeaGlassContext context = getContext(this); LayoutManager lm = (LayoutManager) style.get(context, "InternalFrameTitlePane.titlePaneLayout"); context.dispose(); return (lm != null) ? lm : new SeaGlassTitlePaneLayout(); }
/** * Create the layout manager for the title pane. * * @return the layout manager. */ private LayoutManager createLayout() { SeaGlassContext context = getContext(this); LayoutManager lm = (LayoutManager) style.get(context, "InternalFrameTitlePane.titlePaneLayout"); context.dispose(); return (lm != null) ? lm : new SeaGlassTitlePaneLayout(); }
/** * Resets the menuButton icon to match that of the frame. */ private void updateMenuIcon() { Icon frameIcon = frame.getFrameIcon(); SeaGlassContext context = getContext(this); if (frameIcon != null) { Dimension maxSize = (Dimension) context.getStyle().get(context, "InternalFrameTitlePane.maxFrameIconSize"); int maxWidth = 16; int maxHeight = 16; if (maxSize != null) { maxWidth = maxSize.width; maxHeight = maxSize.height; } if ((frameIcon.getIconWidth() > maxWidth || frameIcon.getIconHeight() > maxHeight) && (frameIcon instanceof ImageIcon)) { frameIcon = new ImageIcon(((ImageIcon) frameIcon).getImage().getScaledInstance(maxWidth, maxHeight, Image.SCALE_SMOOTH)); } } context.dispose(); menuButton.setIcon(frameIcon); }
/** * Resets the menuButton icon to match that of the frame. */ private void updateMenuIcon() { List<Image> iconList = null; if (rootParent instanceof JFrame) { iconList = ((JFrame) rootParent).getIconImages(); } else if (rootParent instanceof JDialog) { iconList = ((JDialog) rootParent).getIconImages(); } Image frameIcon = iconList != null && iconList.size() > 0 ? iconList.get(0) : null; SeaGlassContext context = getContext(this); if (frameIcon != null) { Dimension maxSize = (Dimension) context.getStyle().get(context, "InternalFrameTitlePane.maxFrameIconSize"); int maxWidth = 16; int maxHeight = 16; if (maxSize != null) { maxWidth = maxSize.width; maxHeight = maxSize.height; } menuButton.setIcon(new ImageIcon(frameIcon.getScaledInstance(maxWidth, maxHeight, Image.SCALE_SMOOTH))); } context.dispose(); }
private void updateStyle(JComponent c) { SeaGlassContext context = getContext(c, ENABLED); SynthStyle oldStyle = style; style = SeaGlassLookAndFeel.updateStyle(context, this); if (style != oldStyle) { minimumSize = (Dimension) style.get(context, "OptionPane.minimumSize"); if (minimumSize == null) { minimumSize = new Dimension(262, 90); } if (oldStyle != null) { uninstallKeyboardActions(); installKeyboardActions(); } } context.dispose(); }
private void updateEditorAlignment(JComponent editor) { if (editor instanceof JSpinner.DefaultEditor) { SeaGlassContext context = getContext(spinner); Integer alignment = (Integer)context.getStyle().get( context, "Spinner.editorAlignment"); JTextField text = ((JSpinner.DefaultEditor)editor).getTextField(); if (alignment != null) { text.setHorizontalAlignment(alignment); } // copy across the sizeVariant property to the editor text.putClientProperty("JComponent.sizeVariant", spinner.getClientProperty("JComponent.sizeVariant")); } }
if (style != oldStyle) { if (b.getMargin() == null || (b.getMargin() instanceof UIResource)) { Insets margin = (Insets) style.get(context, getPropertyPrefix() + "margin"); Object value = style.get(context, getPropertyPrefix() + "iconTextGap"); value = style.get(context, getPropertyPrefix() + "contentAreaFilled"); LookAndFeel.installProperty(b, "contentAreaFilled", value != null ? value : Boolean.TRUE);
/** * 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(); }