private JLabel getLabel(Component c) { this.label.setText(getTitle()); this.label.setFont(getFont(c)); this.label.setForeground(getColor(c)); this.label.setComponentOrientation(c.getComponentOrientation()); this.label.setEnabled(c.isEnabled()); return this.label; } }
/** * Returns the minimum dimensions this border requires in order to fully display the border and title. * * @param c the component where this border will be drawn */ public Dimension getMinimumSize(Component c) { Insets insets = getBorderInsets(c); Dimension minSize = new Dimension(insets.right + insets.left, insets.top + insets.bottom); String title = getTitle(); if ((title != null) && !title.isEmpty()) { JLabel label = getLabel(c); Dimension size = label.getPreferredSize(); int position = getPosition(); if ((position != ABOVE_TOP) && (position != BELOW_BOTTOM)) { minSize.width += size.width; } else if (minSize.width < size.width) { minSize.width += size.width; } } return minSize; }
String title = getTitle(); if ((title != null) && !title.isEmpty()) { int edge = (border instanceof JideTitledBorder) ? 0 : EDGE_SPACING;
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Border border = getBorderUI(); String title = getTitle(); if ((title != null) && !title.isEmpty()) { int edge = (border instanceof JideTitledBorder) ? 0 : EDGE_SPACING;
insets.set(i.top, i.left, i.bottom, i.right); String title = getTitle(); if ((title != null) && !title.isEmpty()) { int edge = (border instanceof JideTitledBorder) ? 0 : EDGE_SPACING;