@Test public void testPaintBorder() { System.out.println("paintBorder"); Component c = null; Graphics g = null; int x = 0; int y = 0; int width = 20; int height = 5; ComponentBorder instance = new ComponentBorder(new JButton("test")); instance.paintBorder(c, g, x, y, width, height); }
@Override public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { float x2 = (width - component.getWidth()) * component.getAlignmentX() + x; float y2 = (height - component.getHeight()) * component.getAlignmentY() + y; component.setLocation((int) x2, (int) y2); }
ComponentBorder implements Border { @Override public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { float x2 = (width - component.getWidth()) * component.getAlignmentX() + x; float y2 = (height - component.getHeight()) * component.getAlignmentY() + y; component.setLocation((int) x2, (int) y2); } }
ComponentBorder implements Border { @Override public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { float x2 = (width - component.getWidth()) * component.getAlignmentX() + x; float y2 = (height - component.getHeight()) * component.getAlignmentY() + y; component.setLocation((int) x2, (int) y2); } ComponentBorder(JComponent component);  ComponentBorder(JComponent component, Edge edge);  ComponentBorder(JComponent component, Edge edge, float alignment); }
ComponentBorder implements Border { @Override public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { float x2 = (width - component.getWidth()) * component.getAlignmentX() + x; float y2 = (height - component.getHeight()) * component.getAlignmentY() + y; component.setLocation((int) x2, (int) y2); } ComponentBorder(JComponent component);  ComponentBorder(JComponent component, Edge edge);  ComponentBorder(JComponent component, Edge edge, float alignment); boolean isAdjustInsets(); void setAdjustInsets(boolean adjustInsets); float getAlignment(); final void setAlignment(float alignment); Edge getEdge(); final void setEdge(Edge edge); int getGap(); void setGap(int gap); @Override Insets getBorderInsets(Component c); @Override boolean isBorderOpaque(); @Override void paintBorder(Component c, Graphics g, int x, int y, int width, int height); void install(JComponent parent); }
ComponentBorder implements Border { @Override public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { float x2 = (width - component.getWidth()) * component.getAlignmentX() + x; float y2 = (height - component.getHeight()) * component.getAlignmentY() + y; component.setLocation((int) x2, (int) y2); } ComponentBorder(JComponent component);  ComponentBorder(JComponent component, Edge edge);  ComponentBorder(JComponent component, Edge edge, float alignment); boolean isAdjustInsets(); void setAdjustInsets(boolean adjustInsets); float getAlignment(); final void setAlignment(float alignment); Edge getEdge(); final void setEdge(Edge edge); int getGap(); void setGap(int gap); @Override Insets getBorderInsets(Component c); @Override boolean isBorderOpaque(); @Override void paintBorder(Component c, Graphics g, int x, int y, int width, int height); void install(JComponent parent); static final float LEADING; static final float CENTER; static final float TRAILING; }