button.setRolloverEnabled(true); button.setOpaque(false); button.setUI(new BasicButtonUI()); button.setContentAreaFilled(false); button.setFocusable(false);
public ArrowIcon(int iconSize, int direction, boolean isEnabled) { this.size = iconSize / 2; this.iconSize = iconSize; this.direction = direction; this.isEnabled = isEnabled; this.iconRenderer = new BasicArrowButton(direction); }
@Override protected void finishDraggingTo(int location) { super.finishDraggingTo(location + JSplitPaneWithZeroSizeDivider.this.dividerDragOffset); } }
g2D.setColor(hazAlfa(getRunForTab(tabPane.getTabCount(), tabIndex) - 1)); g2D.fill(shape); super.paintText(g, tabPlacement, font, metrics, tabIndex, title, textRect, isSelected); g.setFont(font); View v = getTextViewForTab(tabIndex); if (v != null) { if (tabPane.isEnabled() && tabPane.isEnabledAt(tabIndex)) { g.setColor(tabPane.getForegroundAt(tabIndex)); BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); } else { // tab disabled g.setColor(Color.BLACK); BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); g.setColor(tabPane.getBackgroundAt(tabIndex).darker()); BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x - 1, textRect.y + metrics.getAscent() - 1);
@Override public void doLayout() { super.doLayout(); // increase divider width or height BasicSplitPaneDivider divider = ((BasicSplitPaneUI) this.getUI()).getDivider(); Rectangle bounds = divider.getBounds(); if (this.orientation == HORIZONTAL_SPLIT) { bounds.x -= this.dividerDragOffset; bounds.width = this.dividerDragSize; } else { bounds.y -= this.dividerDragOffset; bounds.height = this.dividerDragSize; } divider.setBounds(bounds); }
@Override public void paint(Graphics g, JComponent c) { AbstractButton button = (AbstractButton) c; ButtonModel model = button.getModel(); Dimension size = button.getSize(); if (!model.isPressed() || !model.isArmed()) { paintButtonUnpressed(g, size); } super.paint(g, button); paintBorder(g, size); }
public ZeroSizeDivider(BasicSplitPaneUI ui) { super(ui); super.setBorder(null); this.setBackground(HelperUi.COLOR_COMPONENT_BORDER); }
@Override public void installUI(JComponent component) { super.installUI(component); JButton button = (JButton)component; button.setBorderPainted(false); }
/** * Installs this UI to the given text component. */ @Override public void installUI(JComponent c) { if (!(c instanceof RTextArea)) { throw new Error("RTextAreaUI needs an instance of RTextArea!"); } super.installUI(c); }
paintText(g, b, b.getBounds(), b.getText()); g.setColor(Color.red.brighter()); g.fillRect(0, 0, b.getSize().width, b.getSize().height);
@Override protected void installDefaults() { super.installDefaults(); JTextComponent editor = getComponent(); editor.setFont(RTextAreaBase.getDefaultFont()); // Nimbus (and possibly other Synth lafs) doesn't play by BasicLaf // rules and doesn't set properties needed by custom BasicTextAreaUI's. correctNimbusDefaultProblems(editor); editor.setTransferHandler(DEFAULT_TRANSFER_HANDLER); }
@Override protected void paintSafely(Graphics g) { // Paint editor augmentations if editor is not opaque because // paintBackground() is not called in this case if (!textArea.isOpaque()) { paintEditorAugmentations(g); } super.paintSafely(g); }
/** * {@inheritDoc} */ @Override public void install(JTextComponent c) { super.install(c); this.textArea = (RTextArea)c; }
@Override public void paintIcon(Component c, Graphics g, int x, int y) { // Fix #4731: ClassCastException on paintTriangle() // Implementation by sun.awt.image try { this.iconRenderer.paintTriangle(g, x, y + 3, this.size, this.direction, this.isEnabled); } catch(ClassCastException e) { LOGGER.error(e.getMessage(), e); } }
/** * When leaf Views (such as LabelView) are rendering they should * call into this method. If a highlight is in the given region it will * be drawn immediately. * * @param g Graphics used to draw * @param lineStart starting offset of view * @param lineEnd ending offset of view * @param viewBounds Bounds of View * @param editor JTextComponent * @param view View instance being rendered */ @Override public void paintLayeredHighlights(Graphics g, int lineStart, int lineEnd, Shape viewBounds, JTextComponent editor, View view) { paintListLayered(g, lineStart,lineEnd, viewBounds, editor, view, markAllHighlights); super.paintLayeredHighlights(g, lineStart, lineEnd, viewBounds, editor, view); }
RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); r = getBox(r); g.setColor(progressBar.getForeground()); g.fillOval(r.x, r.y, r.width, r.height);
@Override protected void dragDividerTo(int location) { super.dragDividerTo(location + JSplitPaneWithZeroSizeDivider.this.dividerDragOffset); }
@Override public void paint(Graphics g, JComponent c) { AbstractButton button = (AbstractButton) c; GaugeButtonModel model = (GaugeButtonModel) button.getModel(); Dimension size = button.getSize(); boolean isUnpressed = !model.isPressed() || !model.isArmed(); if (isUnpressed && model.isRollover()) paintButtonUnpressed(g, size); super.paint(g, button); if(model.isRollover()) paintBorder(g, size); paintLights(model.lights(), g); }
@Override public void installUI(JComponent component) { super.installUI(component); JButton button = (JButton)component; button.setBorderPainted(false); }
@Override public void installUI(JComponent component) { super.installUI(component); JButton button = (JButton)component; button.setSize(new Dimension(17, 16)); button.setOpaque(false); button.setBorderPainted(false); }