|
|
|
@ -90,6 +90,37 @@ public abstract class ComponentPreviewPane extends UINoOpaquePanel implements Th
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected void paintBorder(Graphics g) { |
|
|
|
|
super.paintBorder(g); |
|
|
|
|
|
|
|
|
|
paintSeparator((Graphics2D) g); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void paintSeparator(Graphics2D g2d) { |
|
|
|
|
Border border = getBorder(); |
|
|
|
|
if (border instanceof LineBorder && titlePane != null) { |
|
|
|
|
Border containerBorder = container.getBorder(); |
|
|
|
|
Insets insets = containerBorder.getBorderInsets(container); |
|
|
|
|
int y = titlePane.getHeight() + insets.top; |
|
|
|
|
|
|
|
|
|
Color oldColor = g2d.getColor(); |
|
|
|
|
Stroke oldStroke = g2d.getStroke(); |
|
|
|
|
|
|
|
|
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
|
|
|
|
|
|
|
|
|
Color lineColor = ((LineBorder) border).getLineColor(); |
|
|
|
|
int thickness = ((LineBorder) border).getThickness(); |
|
|
|
|
g2d.setColor(lineColor); |
|
|
|
|
g2d.setStroke(new BasicStroke(thickness * 2)); |
|
|
|
|
g2d.drawLine(0, y, getWidth(), y); |
|
|
|
|
|
|
|
|
|
g2d.setStroke(oldStroke); |
|
|
|
|
g2d.setColor(oldColor); |
|
|
|
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void paint(Graphics g) { |
|
|
|
|
Graphics2D g2d = (Graphics2D) g; |
|
|
|
@ -144,7 +175,6 @@ public abstract class ComponentPreviewPane extends UINoOpaquePanel implements Th
|
|
|
|
|
data.setInsetImagePadding(titlePacker.getInsetImagePadding()); |
|
|
|
|
data.setInsetRelativeTextLeft(titlePacker.isInsetRelativeTextLeft()); |
|
|
|
|
data.setInsetRelativeTextRight(titlePacker.isInsetRelativeTextRight()); |
|
|
|
|
this.setBorder(new BottomLineBorder(componentStyle.getStyle().getColor(), componentStyle.getStyle().getBorder())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Label getData(){ |
|
|
|
@ -172,31 +202,6 @@ public abstract class ComponentPreviewPane extends UINoOpaquePanel implements Th
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static class BottomLineBorder extends LineBorder { |
|
|
|
|
|
|
|
|
|
private BottomLineBorder(Color color, int thickness) { |
|
|
|
|
super(color, thickness); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { |
|
|
|
|
Graphics2D g2d = (Graphics2D) g; |
|
|
|
|
|
|
|
|
|
Color oldColor = g2d.getColor(); |
|
|
|
|
Stroke oldStroke = g2d.getStroke(); |
|
|
|
|
|
|
|
|
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
|
|
|
|
|
|
|
|
|
g2d.setColor(getLineColor()); |
|
|
|
|
g2d.setStroke(new BasicStroke(getThickness() * 2)); |
|
|
|
|
g2d.drawLine(0, height, width, height); |
|
|
|
|
|
|
|
|
|
g2d.setStroke(oldStroke); |
|
|
|
|
g2d.setColor(oldColor); |
|
|
|
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static class Utils { |
|
|
|
|
private static void paintBackground(Graphics2D g2d, Background background, Shape shape, float opacity) { |
|
|
|
|