本文整理汇总了Java中org.insightech.er.editor.model.settings.PageSetting.getWidth方法的典型用法代码示例。如果您正苦于以下问题:Java PageSetting.getWidth方法的具体用法?Java PageSetting.getWidth怎么用?Java PageSetting.getWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.insightech.er.editor.model.settings.PageSetting
的用法示例。
在下文中一共展示了PageSetting.getWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: paintGrid
import org.insightech.er.editor.model.settings.PageSetting; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void paintGrid(final Graphics g) {
super.paintGrid(g);
final Rectangle clip = g.getClip(Rectangle.SINGLETON);
final PageSetting pageSetting = diagram.getPageSetting();
final int width = pageSetting.getWidth();
final int height = pageSetting.getHeight();
final Rectangle rect = clip;
final Color color = g.getForegroundColor();
g.setForegroundColor(ColorConstants.lightGray);
int startX = rect.x;
if (startX > 0) {
startX = 0;
}
int startY = rect.y;
if (startY > 0) {
startY = 0;
}
for (int i = startX; i < rect.x + rect.width; i += width) {
g.drawLine(i, rect.y, i, rect.y + rect.height);
}
for (int i = startY; i < rect.y + rect.height; i += height) {
g.drawLine(rect.x, i, rect.x + rect.width, i);
}
g.setForegroundColor(color);
i++;
if (i > 0) {
i = -1;
repaint();
}
}
示例2: paintGrid
import org.insightech.er.editor.model.settings.PageSetting; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void paintGrid(Graphics g) {
super.paintGrid(g);
Rectangle clip = g.getClip(Rectangle.SINGLETON);
PageSetting pageSetting = diagram.getPageSetting();
int width = pageSetting.getWidth();
int height = pageSetting.getHeight();
Rectangle rect = clip;
Color color = g.getForegroundColor();
g.setForegroundColor(ColorConstants.lightGray);
int startX = rect.x;
if (startX > 0) {
startX = 0;
}
int startY = rect.y;
if (startY > 0) {
startY = 0;
}
for (int i = startX; i < rect.x + rect.width; i += width) {
g.drawLine(i, rect.y, i, rect.y + rect.height);
}
for (int i = startY; i < rect.y + rect.height; i += height) {
g.drawLine(rect.x, i, rect.x + rect.width, i);
}
g.setForegroundColor(color);
i++;
if (i > 0) {
i = -1;
repaint();
}
}