本文整理匯總了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();
}
}