本文整理汇总了Java中edu.uci.ics.jung.visualization.transform.shape.ShapeTransformer.inverseTransform方法的典型用法代码示例。如果您正苦于以下问题:Java ShapeTransformer.inverseTransform方法的具体用法?Java ShapeTransformer.inverseTransform怎么用?Java ShapeTransformer.inverseTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.uci.ics.jung.visualization.transform.shape.ShapeTransformer
的用法示例。
在下文中一共展示了ShapeTransformer.inverseTransform方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: paint
import edu.uci.ics.jung.visualization.transform.shape.ShapeTransformer; //导入方法依赖的package包/类
@Override
public void paint(Graphics g) {
ShapeTransformer masterViewTransformer = master.getRenderContext()
.getMultiLayerTransformer().getTransformer(Layer.VIEW);
ShapeTransformer masterLayoutTransformer = master
.getRenderContext().getMultiLayerTransformer()
.getTransformer(Layer.LAYOUT);
ShapeTransformer vvLayoutTransformer = vv.getRenderContext()
.getMultiLayerTransformer().getTransformer(Layer.LAYOUT);
// changed: bounds without offset
Shape lens = new Rectangle(new Point(), master.getSize());
lens = masterViewTransformer.inverseTransform(lens);
lens = masterLayoutTransformer.inverseTransform(lens);
lens = vvLayoutTransformer.transform(lens);
Graphics2D g2d = (Graphics2D) g;
Color old = g.getColor();
Color lensColor = master.getBackground();
vv.setBackground(lensColor.darker());
g.setColor(lensColor);
g2d.fill(lens);
g.setColor(Color.gray);
g2d.draw(lens);
g.setColor(old);
}
示例2: paint
import edu.uci.ics.jung.visualization.transform.shape.ShapeTransformer; //导入方法依赖的package包/类
@Override
public void paint(Graphics g) {
ShapeTransformer masterViewTransformer = master.getRenderContext()
.getMultiLayerTransformer().getTransformer(Layer.VIEW);
ShapeTransformer masterLayoutTransformer = master
.getRenderContext().getMultiLayerTransformer()
.getTransformer(Layer.LAYOUT);
ShapeTransformer vvLayoutTransformer = vv.getRenderContext()
.getMultiLayerTransformer().getTransformer(Layer.LAYOUT);
// changed: bounds without offset
Shape lens = new Rectangle(new Point(), master.getSize());
lens = masterViewTransformer.inverseTransform(lens);
lens = masterLayoutTransformer.inverseTransform(lens);
lens = vvLayoutTransformer.transform(lens);
Graphics2D g2d = (Graphics2D) g;
Color old = g.getColor();
Color lensColor = master.getBackground();
vv.setBackground(lensColor.darker());
g.setColor(lensColor);
g2d.fill(lens);
g.setColor(Color.gray);
g2d.draw(lens);
g.setColor(old);
}
示例3: paint
import edu.uci.ics.jung.visualization.transform.shape.ShapeTransformer; //导入方法依赖的package包/类
public void paint(Graphics g) {
ShapeTransformer masterViewTransformer =
master.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.VIEW);
ShapeTransformer masterLayoutTransformer = master.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT);
ShapeTransformer vvLayoutTransformer = vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT);
Shape lens = master.getBounds();
lens = masterViewTransformer.inverseTransform(lens);
lens = masterLayoutTransformer.inverseTransform(lens);
lens = vvLayoutTransformer.transform(lens);
Graphics2D g2d = (Graphics2D)g;
Color old = g.getColor();
Color lensColor = master.getBackground();
vv.setBackground(lensColor.darker());
g.setColor(lensColor);
g2d.fill(lens);
g.setColor(Color.gray);
g2d.draw(lens);
g.setColor(old);
}
示例4: paint
import edu.uci.ics.jung.visualization.transform.shape.ShapeTransformer; //导入方法依赖的package包/类
public void paint(Graphics g) {
ShapeTransformer masterViewTransformer = master.getViewTransformer();
ShapeTransformer masterLayoutTransformer = master.getLayoutTransformer();
ShapeTransformer vvLayoutTransformer = vv.getLayoutTransformer();
Shape lens = master.getBounds();
lens = masterViewTransformer.inverseTransform(lens);
lens = masterLayoutTransformer.inverseTransform(lens);
lens = vvLayoutTransformer.transform(lens);
Graphics2D g2d = (Graphics2D)g;
Color old = g.getColor();
Color lensColor = master.getBackground();
vv.setBackground(lensColor.darker());
g.setColor(lensColor);
g2d.fill(lens);
g.setColor(Color.gray);
g2d.draw(lens);
g.setColor(old);
}
示例5: paint
import edu.uci.ics.jung.visualization.transform.shape.ShapeTransformer; //导入方法依赖的package包/类
public void paint(Graphics g) {
ShapeTransformer masterViewTransformer = master.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.VIEW);
ShapeTransformer masterLayoutTransformer = master.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT);
ShapeTransformer vvLayoutTransformer = vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT);
Rectangle rect = master.getBounds();
GeneralPath path = new GeneralPath();
path.moveTo(rect.x, rect.y);
path.lineTo(rect.width,rect.y);
path.lineTo(rect.width, rect.height);
path.lineTo(rect.x, rect.height);
path.lineTo(rect.x, rect.y);
for(int i=0; i<=rect.width; i+=rect.width/10) {
path.moveTo(rect.x+i, rect.y);
path.lineTo(rect.x+i, rect.height);
}
for(int i=0; i<=rect.height; i+=rect.height/10) {
path.moveTo(rect.x, rect.y+i);
path.lineTo(rect.width, rect.y+i);
}
Shape lens = path;
lens = masterViewTransformer.inverseTransform(lens);
lens = masterLayoutTransformer.inverseTransform(lens);
lens = vvLayoutTransformer.transform(lens);
Graphics2D g2d = (Graphics2D)g;
Color old = g.getColor();
g.setColor(Color.cyan);
g2d.draw(lens);
path = new GeneralPath();
path.moveTo((float)rect.getMinX(), (float)rect.getCenterY());
path.lineTo((float)rect.getMaxX(), (float)rect.getCenterY());
path.moveTo((float)rect.getCenterX(), (float)rect.getMinY());
path.lineTo((float)rect.getCenterX(), (float)rect.getMaxY());
Shape crosshairShape = path;
crosshairShape = masterViewTransformer.inverseTransform(crosshairShape);
crosshairShape = masterLayoutTransformer.inverseTransform(crosshairShape);
crosshairShape = vvLayoutTransformer.transform(crosshairShape);
g.setColor(Color.black);
g2d.setStroke(new BasicStroke(3));
g2d.draw(crosshairShape);
g.setColor(old);
}
示例6: paint
import edu.uci.ics.jung.visualization.transform.shape.ShapeTransformer; //导入方法依赖的package包/类
public void paint(Graphics g) {
ShapeTransformer masterViewTransformer = master.getViewTransformer();
ShapeTransformer masterLayoutTransformer = master.getLayoutTransformer();
ShapeTransformer vvLayoutTransformer = vv.getLayoutTransformer();
Rectangle rect = master.getBounds();
GeneralPath path = new GeneralPath();
path.moveTo(rect.x, rect.y);
path.lineTo(rect.width,rect.y);
path.lineTo(rect.width, rect.height);
path.lineTo(rect.x, rect.height);
path.lineTo(rect.x, rect.y);
for(int i=0; i<=rect.width; i+=rect.width/10) {
path.moveTo(rect.x+i, rect.y);
path.lineTo(rect.x+i, rect.height);
}
for(int i=0; i<=rect.height; i+=rect.height/10) {
path.moveTo(rect.x, rect.y+i);
path.lineTo(rect.width, rect.y+i);
}
Shape lens = path;
lens = masterViewTransformer.inverseTransform(lens);
lens = masterLayoutTransformer.inverseTransform(lens);
lens = vvLayoutTransformer.transform(lens);
Graphics2D g2d = (Graphics2D)g;
Color old = g.getColor();
g.setColor(Color.cyan);
g2d.draw(lens);
path = new GeneralPath();
path.moveTo((float)rect.getMinX(), (float)rect.getCenterY());
path.lineTo((float)rect.getMaxX(), (float)rect.getCenterY());
path.moveTo((float)rect.getCenterX(), (float)rect.getMinY());
path.lineTo((float)rect.getCenterX(), (float)rect.getMaxY());
Shape crosshairShape = path;
crosshairShape = masterViewTransformer.inverseTransform(crosshairShape);
crosshairShape = masterLayoutTransformer.inverseTransform(crosshairShape);
crosshairShape = vvLayoutTransformer.transform(crosshairShape);
g.setColor(Color.black);
g2d.setStroke(new BasicStroke(3));
g2d.draw(crosshairShape);
g.setColor(old);
}