private int calculateY(final int imgHeight, final int height) { int y = 0; if(getVerticalAlignment() == VerticalAlignment.TOP) { y = 0; y+= insets.top; } if(getVerticalAlignment() == VerticalAlignment.CENTER) { y = (height-imgHeight)/2; y += insets.top; } if(getVerticalAlignment() == VerticalAlignment.BOTTOM) { y = height-imgHeight; y-= insets.bottom; } return y; }
private int calculateY(final int imgHeight, final int height) { int y = 0; if(getVerticalAlignment() == VerticalAlignment.TOP) { y = 0; y+= insets.top; } if(getVerticalAlignment() == VerticalAlignment.CENTER) { y = (height-imgHeight)/2; y += insets.top; } if(getVerticalAlignment() == VerticalAlignment.BOTTOM) { y = height-imgHeight; y-= insets.bottom; } return y; }
private int calculateY(final int imgHeight, final int height) { int y = 0; if(getVerticalAlignment() == VerticalAlignment.TOP) { y = 0; y+= insets.top; } if(getVerticalAlignment() == VerticalAlignment.CENTER) { y = (height-imgHeight)/2; y += insets.top; } if(getVerticalAlignment() == VerticalAlignment.BOTTOM) { y = height-imgHeight; y-= insets.bottom; } return y; }
private int calculateY(final int imgHeight, final int height) { int y = 0; if(getVerticalAlignment() == VerticalAlignment.TOP) { y = 0; y+= insets.top; } if(getVerticalAlignment() == VerticalAlignment.CENTER) { y = (height-imgHeight)/2; y += insets.top; } if(getVerticalAlignment() == VerticalAlignment.BOTTOM) { y = height-imgHeight; y-= insets.bottom; } return y; }
private int calculateY(final int imgHeight, final int height) { int y = 0; if (getVerticalAlignment() == VerticalAlignment.TOP) { y = 0; y += insets.top; } if (getVerticalAlignment() == VerticalAlignment.CENTER) { y = (height - imgHeight) / 2; y += insets.top; } if (getVerticalAlignment() == VerticalAlignment.BOTTOM) { y = height - imgHeight; y -= insets.bottom; } return y; }
/** * Sets a new verticalAlignment alignment. Used to position the content at the top, bottom, or center. * * @param vertical new verticalAlignment alignment */ public void setVerticalAlignment(VerticalAlignment vertical) { VerticalAlignment old = this.getVerticalAlignment(); this.verticalAlignment = vertical; setDirty(true); firePropertyChange("verticalAlignment", old, getVerticalAlignment()); }
/** * Sets a new verticalAlignment alignment. Used to position the content at the top, bottom, or center. * * @param vertical new verticalAlignment alignment */ public void setVerticalAlignment(VerticalAlignment vertical) { VerticalAlignment old = this.getVerticalAlignment(); this.verticalAlignment = vertical; setDirty(true); firePropertyChange("verticalAlignment", old, getVerticalAlignment()); }
/** * Sets a new verticalAlignment alignment. Used to position the content at the top, bottom, or center. * * @param vertical new verticalAlignment alignment */ public void setVerticalAlignment(VerticalAlignment vertical) { VerticalAlignment old = this.getVerticalAlignment(); this.verticalAlignment = vertical; setDirty(true); firePropertyChange("verticalAlignment", old, getVerticalAlignment()); }
/** * Sets a new verticalAlignment alignment. Used to position the content at the top, bottom, or center. * * @param vertical new verticalAlignment alignment */ public void setVerticalAlignment(VerticalAlignment vertical) { VerticalAlignment old = this.getVerticalAlignment(); this.verticalAlignment = vertical; setDirty(true); firePropertyChange("verticalAlignment", old, getVerticalAlignment()); }
/** * Sets a new verticalAlignment alignment. Used to position the content at the top, bottom, or center. * * @param vertical new verticalAlignment alignment */ public void setVerticalAlignment(VerticalAlignment vertical) { VerticalAlignment old = this.getVerticalAlignment(); this.verticalAlignment = vertical; setDirty(true); firePropertyChange("vertical",old,this.verticalAlignment); }
@Test @Override public void testDefaults() { super.testDefaults(); AbstractLayoutPainter alp = (AbstractLayoutPainter) p; assertThat(alp.getHorizontalAlignment(), is(AbstractLayoutPainter.HorizontalAlignment.CENTER)); assertThat(alp.getInsets(), is(new Insets(0, 0, 0, 0))); assertThat(alp.getVerticalAlignment(), is(AbstractLayoutPainter.VerticalAlignment.CENTER)); assertThat(alp.isFillHorizontal(), is(false)); assertThat(alp.isFillVertical(), is(false)); } }
assertThat(alp.getHorizontalAlignment(), is(AbstractLayoutPainter.HorizontalAlignment.CENTER)); assertThat(alp.getInsets(), is(new Insets(0, 0, 0, 0))); assertThat(alp.getVerticalAlignment(), is(AbstractLayoutPainter.VerticalAlignment.CENTER)); assertThat(alp.isFillHorizontal(), is(true)); assertThat(alp.isFillVertical(), is(true));
assertThat(alp.getHorizontalAlignment(), is(AbstractLayoutPainter.HorizontalAlignment.CENTER)); assertThat(alp.getInsets(), is(new Insets(0, 0, 0, 0))); assertThat(alp.getVerticalAlignment(), is(AbstractLayoutPainter.VerticalAlignment.CENTER)); assertThat(alp.isFillHorizontal(), is(false)); assertThat(alp.isFillVertical(), is(false));