- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.weasis.core.ui.editor.image.ZoomWin
类的一些代码示例,展示了ZoomWin
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoomWin
类的具体详情如下:
包路径:org.weasis.core.ui.editor.image.ZoomWin
类名称:ZoomWin
[英]The Class ZoomWin.
[中]全班同学都在放大。
代码示例来源:origin: nroduit/Weasis
protected void draw(Graphics2D g2d) {
Stroke oldStroke = g2d.getStroke();
Paint oldColor = g2d.getPaint();
Shape oldClip = g2d.getClip();
g2d.clip(shape);
g2d.setBackground(backgroundColor);
drawBackground(g2d);
// Set font size according to the view size
g2d.setFont(MeasureTool.viewSetting.getFont());
// Paint the visible area
Point2D p = getClipViewCoordinatesOffset();
g2d.translate(p.getX(), p.getY());
imageLayer.drawImage(g2d);
drawLayers(g2d, affineTransform, inverseTransform);
g2d.translate(-p.getX(), -p.getY());
g2d.setClip(oldClip);
g2d.setStroke(stroke);
g2d.setPaint(lineColor);
Rectangle bound = getBounds();
g2d.drawRect(bound.width - 12 - borderOffset, bound.height - 12 - borderOffset, 12, 12);
g2d.draw(shape);
g2d.setPaint(oldColor);
g2d.setStroke(oldStroke);
}
代码示例来源:origin: nroduit/Weasis
public void centerZoomWin() {
int magPosx = (view2d.getWidth() / 2) - (getWidth() / 2);
int magPosy = (view2d.getHeight() / 2) - (getHeight() / 2);
setLocation(magPosx, magPosy);
}
代码示例来源:origin: nroduit/Weasis
public void showLens(boolean val) {
if (val) {
updateImage();
refreshZoomWin();
updateZoom();
enableMouseListener();
setVisible(true);
} else {
setVisible(false);
view2d.graphicManager.removeGraphicChangeHandler(graphicsChangeHandler);
disableMouseAndKeyListener();
}
}
代码示例来源:origin: nroduit/Weasis
public void enableMouseListener() {
disableMouseAndKeyListener();
this.addMouseListener(mouseHandler);
this.addMouseMotionListener(mouseHandler);
this.addMouseWheelListener((MouseActionAdapter) view2d.getEventManager().getAction(ActionW.LENSZOOM));
}
代码示例来源:origin: nroduit/Weasis
private void refreshZoomWin() {
Point loc = getLocation();
if (loc.x == -1 && loc.y == -1) {
centerZoomWin();
return;
}
Rectangle rect = view2d.getBounds();
rect.x = 0;
rect.y = 0;
Rectangle2D r = rect.createIntersection(getBounds());
if (r.getWidth() < 25.0 || r.getHeight() < 25.0) {
centerZoomWin();
}
}
代码示例来源:origin: nroduit/Weasis
int h = getHeight();
if (w != 0 && h != 0) {
Rectangle bound = lens.getBounds();
if (oldSize.width != 0 && oldSize.height != 0) {
int centerx = bound.width / 2;
bound.x = (bound.x + centerx) * w / oldSize.width - centerx;
bound.y = (bound.y + centery) * h / oldSize.height - centery;
lens.setLocation(bound.x, bound.y);
lens.updateZoom();
代码示例来源:origin: nroduit/Weasis
lens.setActionInView(ActionW.ZOOM.cmd(), entry.getValue());
lens.updateZoom();
if (showLens) {
if (lens == null) {
lens = new ZoomWin<>(this);
lens.setSize(lens.getWidth() > maxWidth ? maxWidth : lens.getWidth(),
lens.getHeight() > maxHeight ? maxHeight : lens.getHeight());
this.add(lens);
lens.showLens(true);
代码示例来源:origin: nroduit/Weasis
public ZoomWin(DefaultView2d<E> view2d) {
super(null);
this.view2d = view2d;
this.setOpaque(false);
ImageViewerEventManager<E> manager = view2d.getEventManager();
this.imageLayer = new RenderedImageLayer<>();
SimpleOpManager operations = imageLayer.getDisplayOpManager();
operations.addImageOperationAction(new AffineTransformOp());
ActionState zoomAction = manager.getAction(ActionW.LENSZOOM);
if (zoomAction instanceof SliderChangeListener) {
actionsInView.put(ActionW.ZOOM.cmd(), ((SliderChangeListener) zoomAction).getRealValue());
}
this.popup = new PopUpMenuOnZoom(this);
this.popup.setInvoker(this);
this.setCursor(DefaultView2d.MOVE_CURSOR);
ZoomSetting z = manager.getZoomSetting();
OpManager disOp = getDisplayOpManager();
disOp.setParamValue(AffineTransformOp.OP_NAME, AffineTransformOp.P_INTERPOLATION, z.getInterpolation());
disOp.setParamValue(AffineTransformOp.OP_NAME, AffineTransformOp.P_AFFINE_MATRIX, null);
actionsInView.put(SYNCH_CMD, z.isLensSynchronize());
actionsInView.put(ActionW.DRAWINGS.cmd(), z.isLensShowDrawings());
actionsInView.put(FREEZE_CMD, SyncType.NONE);
Color bckColor = UIManager.getColor("Panel.background"); //$NON-NLS-1$
this.setLensDecoration(z.getLensLineWidth(), z.getLensLineColor(), bckColor, z.isLensRound());
this.setSize(z.getLensWidth(), z.getLensHeight());
this.setLocation(-1, -1);
this.imageLayer.addLayerChangeListener(this);
this.mouseHandler = new MouseHandler();
}
代码示例来源:origin: nroduit/Weasis
private void init() {
jMenuItemZoom.setText(Messages.getString("PopUpMenuOnZoom.hide")); //$NON-NLS-1$
jMenuItemZoom.addActionListener(e -> zoomWin.hideZoom());
jCheckBoxMenuItemDraw.setText(Messages.getString("PopUpMenuOnZoom.showDraw")); //$NON-NLS-1$
jCheckBoxMenuItemDraw.addActionListener(e -> {
zoomWin.setActionInView(ActionW.DRAWINGS.cmd(), jCheckBoxMenuItemDraw.isSelected());
zoomWin.repaint();
});
jMenuImage.setText(Messages.getString("PopUpMenuOnZoom.image")); //$NON-NLS-1$
final JMenuItem freezParams = new JMenuItem(Messages.getString("PopUpMenuOnZoom.freeze")); //$NON-NLS-1$
freezParams.addActionListener(e -> zoomWin.setFreezeImage(SyncType.PARENT_PARAMETERS));
jMenuImage.add(freezParams);
final JMenuItem freeze = new JMenuItem(Messages.getString("PopUpMenuOnZoom.freezeImg")); //$NON-NLS-1$
freeze.addActionListener(e -> zoomWin.setFreezeImage(SyncType.PARENT_IMAGE));
jMenuImage.add(freeze);
jMenuImage.addSeparator();
resetFreeze.addActionListener(e -> zoomWin.setFreezeImage(null));
jMenuImage.add(resetFreeze);
jCheckBoxMenutemSychronize.setText(Messages.getString("PopUpMenuOnZoom.synch")); //$NON-NLS-1$
jCheckBoxMenutemSychronize.addActionListener(e -> {
zoomWin.setActionInView(ZoomWin.SYNCH_CMD, jCheckBoxMenutemSychronize.isSelected());
zoomWin.updateZoom();
});
this.add(jMenuItemZoom);
代码示例来源:origin: nroduit/Weasis
lens.setCommandFromParentView(command, evt.getNewValue());
lens.updateZoom();
代码示例来源:origin: nroduit/Weasis
public void setFreezeImage(SyncType type) {
actionsInView.put(ZoomWin.FREEZE_CMD, type);
if (Objects.isNull(type) || SyncType.NONE.equals(type)) {
freezeActionsInView.clear();
freezeOperations = null;
actionsInView.put(ZoomWin.FREEZE_CMD, SyncType.NONE);
} else {
freezeParentParameters();
}
imageLayer.updateDisplayOperations();
updateZoom();
}
代码示例来源:origin: nroduit/Weasis
@Override
public void changeZoomInterpolation(Integer interpolation) {
Integer val =
(Integer) getDisplayOpManager().getParamValue(AffineTransformOp.OP_NAME, AffineTransformOp.P_INTERPOLATION);
boolean update = !Objects.equals(val, interpolation);
if (update) {
getDisplayOpManager().setParamValue(AffineTransformOp.OP_NAME, AffineTransformOp.P_INTERPOLATION,
interpolation);
if (lens != null) {
lens.getDisplayOpManager().setParamValue(AffineTransformOp.OP_NAME, AffineTransformOp.P_INTERPOLATION,
interpolation);
lens.updateZoom();
}
imageLayer.updateDisplayOperations();
}
}
代码示例来源:origin: nroduit/Weasis
lens.updateImage();
lens.updateZoom();
代码示例来源:origin: nroduit/Weasis
@Override
public synchronized void enableMouseAndKeyListener(MouseActions actions) {
disableMouseAndKeyListener();
iniDefaultMouseListener();
iniDefaultKeyListener();
// Set the butonMask to 0 of all the actions
resetMouseAdapter();
this.setCursor(DefaultView2d.DEFAULT_CURSOR);
addMouseAdapter(actions.getLeft(), InputEvent.BUTTON1_DOWN_MASK); // left mouse button
if (actions.getMiddle().equals(actions.getLeft())) {
// If mouse action is already registered, only add the modifier mask
addModifierMask(actions.getMiddle(), InputEvent.BUTTON2_DOWN_MASK);
} else {
addMouseAdapter(actions.getMiddle(), InputEvent.BUTTON2_DOWN_MASK);// middle mouse button
}
if (actions.getRight().equals(actions.getLeft()) || actions.getRight().equals(actions.getMiddle())) {
// If mouse action is already registered, only add the modifier mask
addModifierMask(actions.getRight(), InputEvent.BUTTON3_DOWN_MASK);
} else {
addMouseAdapter(actions.getRight(), InputEvent.BUTTON3_DOWN_MASK); // right mouse button
}
this.addMouseWheelListener(getMouseAdapter(actions.getWheel()));
if (lens != null) {
lens.enableMouseListener();
}
}
代码示例来源:origin: nroduit/Weasis
int h = getHeight();
if (w != 0 && h != 0) {
Rectangle bound = lens.getBounds();
if (oldSize.width != 0 && oldSize.height != 0) {
int centerx = bound.width / 2;
bound.x = (bound.x + centerx) * w / oldSize.width - centerx;
bound.y = (bound.y + centery) * h / oldSize.height - centery;
lens.setLocation(bound.x, bound.y);
lens.updateZoom();
代码示例来源:origin: nroduit/Weasis
lens.setCommandFromParentView(name, evt.getNewValue());
lens.updateZoom();
我以前用过ZoomWin:https://github.com/vim-scripts/ZoomWin用于在 Vim 中的一个和多个窗口之间切换。但这个插件有一个大问题。当我尝试恢复多个窗口(垂直分割
本文整理了Java中org.weasis.core.ui.editor.image.ZoomWin.getBounds()方法的一些代码示例,展示了ZoomWin.getBounds()的具体用法。这
本文整理了Java中org.weasis.core.ui.editor.image.ZoomWin.setLocation()方法的一些代码示例,展示了ZoomWin.setLocation()的具体
我是一名优秀的程序员,十分优秀!