javax.swing.JComponent.getAlignmentX()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(172)

本文整理了Java中javax.swing.JComponent.getAlignmentX()方法的一些代码示例,展示了JComponent.getAlignmentX()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComponent.getAlignmentX()方法的具体详情如下:
包路径:javax.swing.JComponent
类名称:JComponent
方法名:getAlignmentX

JComponent.getAlignmentX介绍

暂无

代码示例

代码示例来源:origin: ron190/jsql-injection

/**
 *  In this case a real component is to be painted. Setting the location
 *  of the component will cause it to be painted at that location.
 */
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
  
  float x2 =
    ComponentOrientation.getOrientation(I18n.getLocaleDefault()) == ComponentOrientation.RIGHT_TO_LEFT
    ? (0 + this.component.getWidth()) * this.component.getAlignmentX() + x
    : (width - this.component.getWidth()) * this.component.getAlignmentX() + x;
  float y2 = (height - this.component.getHeight()) * this.component.getAlignmentY() + y;
  this.component.setLocation((int) x2 + this.addX, (int) y2 + this.addY);
}

代码示例来源:origin: undera/jmeter-plugins

/**
 *  In this case a real component is to be painted. Setting the location
 *  of the component will cause it to be painted at that location.
 */
@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);
}

代码示例来源:origin: kg.apc/jmeter-plugins-cmn-jmeter

/**
 *  In this case a real component is to be painted. Setting the location
 *  of the component will cause it to be painted at that location.
 */
@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);
}

代码示例来源:origin: MegaMek/mekhq

/**
 *  In this case a real component is to be painted. Setting the location
 *  of the component will cause it to be painted at that location.
 */
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);
}

代码示例来源:origin: stackoverflow.com

float x2 = (width  - component.getWidth())  * component.getAlignmentX() + x;
float y2 = (height - component.getHeight()) * component.getAlignmentY() + y;
component.setLocation((int)x2, (int)y2);

相关文章

JComponent类方法