diff --git a/src/main/java/edu/umd/cs/piccolo/PCanvas.java b/src/main/java/edu/umd/cs/piccolo/PCanvas.java index 81cfaa8..894f177 100755 --- a/src/main/java/edu/umd/cs/piccolo/PCanvas.java +++ b/src/main/java/edu/umd/cs/piccolo/PCanvas.java @@ -362,7 +362,7 @@ public void mouseEntered(MouseEvent e) { MouseEvent simulated = null; - if ((e.getModifiersEx() & (InputEvent.BUTTON1_DOWN_MASK | InputEvent.BUTTON2_DOWN_MASK | InputEvent.BUTTON3_DOWN_MASK)) != 0) { + if ((e.getModifiersEx() & (InputEvent.BUTTON1_MASK | InputEvent.BUTTON2_MASK | InputEvent.BUTTON3_MASK)) != 0) { simulated = new MouseEvent((Component)e.getSource(),MouseEvent.MOUSE_DRAGGED,e.getWhen(),e.getModifiers(),e.getX(),e.getY(),e.getClickCount(),e.isPopupTrigger(),e.getButton()); } else { simulated = new MouseEvent((Component)e.getSource(),MouseEvent.MOUSE_MOVED,e.getWhen(),e.getModifiers(),e.getX(),e.getY(),e.getClickCount(),e.isPopupTrigger(),e.getButton()); @@ -375,7 +375,7 @@ public void mouseExited(MouseEvent e) { MouseEvent simulated = null; - if ((e.getModifiersEx() & (InputEvent.BUTTON1_DOWN_MASK | InputEvent.BUTTON2_DOWN_MASK | InputEvent.BUTTON3_DOWN_MASK)) != 0) { + if ((e.getModifiersEx() & (InputEvent.BUTTON1_MASK | InputEvent.BUTTON2_MASK | InputEvent.BUTTON3_MASK)) != 0) { simulated = new MouseEvent((Component)e.getSource(),MouseEvent.MOUSE_DRAGGED,e.getWhen(),e.getModifiers(),e.getX(),e.getY(),e.getClickCount(),e.isPopupTrigger(),e.getButton()); } else { simulated = new MouseEvent((Component)e.getSource(),MouseEvent.MOUSE_MOVED,e.getWhen(),e.getModifiers(),e.getX(),e.getY(),e.getClickCount(),e.isPopupTrigger(),e.getButton()); diff --git a/src/main/java/edu/umd/cs/piccolo/event/PInputEventFilter.java b/src/main/java/edu/umd/cs/piccolo/event/PInputEventFilter.java index 878bff1..ee627c0 100755 --- a/src/main/java/edu/umd/cs/piccolo/event/PInputEventFilter.java +++ b/src/main/java/edu/umd/cs/piccolo/event/PInputEventFilter.java @@ -53,14 +53,14 @@ */ public class PInputEventFilter { - public static int ALL_MODIFIERS_MASK = InputEvent.BUTTON1_DOWN_MASK | - InputEvent.BUTTON2_DOWN_MASK | - InputEvent.BUTTON3_DOWN_MASK | - InputEvent.SHIFT_DOWN_MASK | - InputEvent.CTRL_DOWN_MASK | - InputEvent.ALT_DOWN_MASK | - InputEvent.ALT_GRAPH_DOWN_MASK | - InputEvent.META_DOWN_MASK; + public static int ALL_MODIFIERS_MASK = InputEvent.BUTTON1_MASK | + InputEvent.BUTTON2_MASK | + InputEvent.BUTTON3_MASK | + InputEvent.SHIFT_MASK | + InputEvent.CTRL_MASK | + InputEvent.ALT_MASK | + InputEvent.ALT_GRAPH_MASK | + InputEvent.META_MASK; private int andMask; private int orMask; diff --git a/src/main/java/edu/umd/cs/piccolox/swt/PSWTKeyEvent.java b/src/main/java/edu/umd/cs/piccolox/swt/PSWTKeyEvent.java index 7cccbc3..e40df03 100755 --- a/src/main/java/edu/umd/cs/piccolox/swt/PSWTKeyEvent.java +++ b/src/main/java/edu/umd/cs/piccolox/swt/PSWTKeyEvent.java @@ -74,13 +74,13 @@ if (swtEvent != null) { if ((swtEvent.stateMask & SWT.ALT) != 0) { - modifiers = modifiers | InputEvent.ALT_DOWN_MASK; + modifiers = modifiers | InputEvent.ALT_MASK; } if ((swtEvent.stateMask & SWT.CONTROL) != 0) { - modifiers = modifiers | InputEvent.CTRL_DOWN_MASK; + modifiers = modifiers | InputEvent.CTRL_MASK; } if ((swtEvent.stateMask & SWT.SHIFT) != 0) { - modifiers = modifiers | InputEvent.SHIFT_DOWN_MASK; + modifiers = modifiers | InputEvent.SHIFT_MASK; } } diff --git a/src/main/java/edu/umd/cs/piccolox/swt/PSWTMouseEvent.java b/src/main/java/edu/umd/cs/piccolox/swt/PSWTMouseEvent.java index e78bf44..7877411 100755 --- a/src/main/java/edu/umd/cs/piccolox/swt/PSWTMouseEvent.java +++ b/src/main/java/edu/umd/cs/piccolox/swt/PSWTMouseEvent.java @@ -106,25 +106,25 @@ if (swtEvent != null) { if ((swtEvent.stateMask & SWT.ALT) != 0) { - modifiers = modifiers | InputEvent.ALT_DOWN_MASK; + modifiers = modifiers | InputEvent.ALT_MASK; } if ((swtEvent.stateMask & SWT.CONTROL) != 0) { - modifiers = modifiers | InputEvent.CTRL_DOWN_MASK; + modifiers = modifiers | InputEvent.CTRL_MASK; } if ((swtEvent.stateMask & SWT.SHIFT) != 0) { - modifiers = modifiers | InputEvent.SHIFT_DOWN_MASK; + modifiers = modifiers | InputEvent.SHIFT_MASK; } if (swtEvent.button == 1 || (swtEvent.stateMask & SWT.BUTTON1) != 0) { - modifiers = modifiers | InputEvent.BUTTON1_DOWN_MASK; + modifiers = modifiers | InputEvent.BUTTON1_MASK; } if (swtEvent.button == 2 || (swtEvent.stateMask & SWT.BUTTON2) != 0) { - modifiers = modifiers | InputEvent.BUTTON2_DOWN_MASK; + modifiers = modifiers | InputEvent.BUTTON2_MASK; } if (swtEvent.button == 3 || (swtEvent.stateMask & SWT.BUTTON3) != 0) { - modifiers = modifiers | InputEvent.BUTTON3_DOWN_MASK; + modifiers = modifiers | InputEvent.BUTTON3_MASK; } } diff --git a/src/main/java/jaist/css/covis/RootWindow.java b/src/main/java/jaist/css/covis/RootWindow.java index 8f9f4b9..f83e98f 100644 --- a/src/main/java/jaist/css/covis/RootWindow.java +++ b/src/main/java/jaist/css/covis/RootWindow.java @@ -43,11 +43,11 @@ public class RootWindow implements ActionListener, WindowStateListener { public static ArrayList windows = new ArrayList(); - public PInputEventFilter b1mask = new PInputEventFilter(InputEvent.BUTTON1_DOWN_MASK); + public PInputEventFilter b1mask = new PInputEventFilter(InputEvent.BUTTON1_MASK); - public PInputEventFilter b2mask = new PInputEventFilter(InputEvent.BUTTON2_DOWN_MASK); + public PInputEventFilter b2mask = new PInputEventFilter(InputEvent.BUTTON2_MASK); - public PInputEventFilter b3mask = new PInputEventFilter(InputEvent.BUTTON3_DOWN_MASK); + public PInputEventFilter b3mask = new PInputEventFilter(InputEvent.BUTTON3_MASK); public PInputEventFilter disablemask = new PInputEventFilter(0); @@ -61,32 +61,31 @@ public JMenu windowMenu; public JMenu bufferMenu; - public SrcWindow srcWindow; // あまり聞いてこないモード public JCheckBoxMenuItem isAutoMode; // あまり聞いてこないモード public JCheckBoxMenuItem isAutoMode_obj; - //継承のクラスを表示するモード + // 継承のクラスを表示するモード public JCheckBoxMenuItem isAdvancedMode; - - // public JCheckBoxMenuItem updateMenu; + // public JCheckBoxMenuItem updateMenu; public static int windowid; - public RootWindow(){ + public RootWindow() { CoVisBuffer b = new CoVisBuffer(); constructFrame(); switchBuffer(b); frame.setVisible(true); } - public RootWindow(CoVisBuffer b){ + + public RootWindow(CoVisBuffer b) { buffer = b; constructFrame(); switchBuffer(b); - frame.setSize(b.covisProperty.viewsizex,b.covisProperty.viewsizey); + frame.setSize(b.covisProperty.viewsizex, b.covisProperty.viewsizey); frame.setLocation(b.covisProperty.viewlocx, b.covisProperty.viewlocy); frame.validate(); frame.addWindowStateListener(this); @@ -94,174 +93,187 @@ RootWindow.this.showSrcWin(true); // TODO:段階がすすんだら,起動時に見せるようにする } - public void constructFrame(){ - frame = new MyPFrame(AnchorGarden.WINDOWTITLE+" "+String.valueOf(windowid), false, null); + + public void constructFrame() { + frame = new MyPFrame(AnchorGarden.WINDOWTITLE + " " + String.valueOf(windowid), false, null); RootWindow.windowid++; windows.add(this); frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); - frame.addWindowListener(new WindowListener(){ + frame.addWindowListener(new WindowListener() { public void windowOpened(WindowEvent arg0) { - // System.out.println("open"); - // RootWindow.this.showSrcWin(true); // TODO:段階がすすんだら,起動時に見せるようにする + // System.out.println("open"); + // RootWindow.this.showSrcWin(true); // TODO:段階がすすんだら,起動時に見せるようにする } + public void windowClosing(WindowEvent arg0) { tobeclosed(); } - public void windowClosed(WindowEvent arg0) {} + + public void windowClosed(WindowEvent arg0) { + } + public void windowIconified(WindowEvent arg0) { - if (srcWindow != null){ + if (srcWindow != null) { srcWindow.setState(JFrame.ICONIFIED); } } + public void windowDeiconified(WindowEvent arg0) { - if (srcWindow != null){ - // srcWindow.setVisible(true); + if (srcWindow != null) { + // srcWindow.setVisible(true); srcWindow.setState(JFrame.NORMAL); srcWindow.follow(); } } + public void windowActivated(WindowEvent arg0) { - if (srcWindow != null && srcWindow.getState()!=JFrame.ICONIFIED){ - // srcWindow.setVisible(true); + if (srcWindow != null && srcWindow.getState() != JFrame.ICONIFIED) { + // srcWindow.setVisible(true); srcWindow.setState(JFrame.NORMAL); srcWindow.follow(); } } + public void windowDeactivated(WindowEvent arg0) { } }); - frame.addComponentListener(new ComponentListener(){ + frame.addComponentListener(new ComponentListener() { @Override - public void componentHidden(ComponentEvent arg0) { } + public void componentHidden(ComponentEvent arg0) { + } + @Override public void componentMoved(ComponentEvent arg0) { - if (srcWindow != null && srcWindow.getState()!=JFrame.ICONIFIED){ + if (srcWindow != null && srcWindow.getState() != JFrame.ICONIFIED) { srcWindow.follow(); } } + @Override - public void componentResized(ComponentEvent arg0) { - if (srcWindow != null && srcWindow.getState()!=JFrame.ICONIFIED){ + public void componentResized(ComponentEvent arg0) { + if (srcWindow != null && srcWindow.getState() != JFrame.ICONIFIED) { srcWindow.follow(); } } + @Override - public void componentShown(ComponentEvent arg0) { } + public void componentShown(ComponentEvent arg0) { + } }); initializeMenu(); } - protected void initializeMenu(){ + + protected void initializeMenu() { menuBar = new JMenuBar(); fileMenu = new JMenu("File"); menuBar.add(fileMenu); JMenuItem resetWorld = new JMenuItem("Reset World"); - resetWorld.addActionListener(new ActionListener(){ + resetWorld.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { resetWorld(); - } + } }); fileMenu.add(resetWorld); - - JMenuItem newBuffer = new JMenuItem("new "+RootBuffer.bufferName); - newBuffer.addActionListener(new ActionListener(){ + JMenuItem newBuffer = new JMenuItem("new " + RootBuffer.bufferName); + newBuffer.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { newBuffer(); - } + } }); fileMenu.add(newBuffer); JMenuItem newFrame = new JMenuItem("new Window"); - newFrame.addActionListener(new ActionListener(){ + newFrame.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { newFrame(); - } + } }); fileMenu.add(newFrame); fileMenu.addSeparator(); - // JMenuItem printpreview = new JMenuItem("Print Preview (Portlait)"); - // printpreview.addActionListener(new ActionListener(){ - // public void actionPerformed(ActionEvent arg0) { - //// canvas.setPreferredSize(new Dimension(584,816)); - // frame.setSize(592,876); - // frame.validate(); - // } - // }); - // fileMenu.add(printpreview); + // JMenuItem printpreview = new JMenuItem("Print Preview (Portlait)"); + // printpreview.addActionListener(new ActionListener(){ + // public void actionPerformed(ActionEvent arg0) { + //// canvas.setPreferredSize(new Dimension(584,816)); + // frame.setSize(592,876); + // frame.validate(); + // } + // }); + // fileMenu.add(printpreview); JMenuItem printpreview2 = new JMenuItem("Print Preview (Landscape)"); - printpreview2.addActionListener(new ActionListener(){ + printpreview2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { - // canvas.setPreferredSize(new Dimension(584,816)); - frame.setSize(876,592); + // canvas.setPreferredSize(new Dimension(584,816)); + frame.setSize(876, 592); frame.validate(); - } + } }); fileMenu.add(printpreview2); - // JMenuItem printpreview3 = new JMenuItem("set preview frame (A0 Landscape)"); - // printpreview3.addActionListener(new ActionListener(){ - // public void actionPerformed(ActionEvent arg0) { - //// canvas.setPreferredSize(new Dimension(584,816)); - // frame.setSize(3370+10,2384+60); - // frame.validate(); - // } - // }); - // fileMenu.add(printpreview3); + // JMenuItem printpreview3 = new JMenuItem("set preview frame (A0 Landscape)"); + // printpreview3.addActionListener(new ActionListener(){ + // public void actionPerformed(ActionEvent arg0) { + //// canvas.setPreferredSize(new Dimension(584,816)); + // frame.setSize(3370+10,2384+60); + // frame.validate(); + // } + // }); + // fileMenu.add(printpreview3); -// JMenuItem print = new JMenuItem("Print"); -// print.addActionListener(new ActionListener(){ -// public void actionPerformed(ActionEvent arg0) { -//// PrintPrintable.print(canvas.cam); -// } -// }); -// fileMenu.add(print); + // JMenuItem print = new JMenuItem("Print"); + // print.addActionListener(new ActionListener(){ + // public void actionPerformed(ActionEvent arg0) { + //// PrintPrintable.print(canvas.cam); + // } + // }); + // fileMenu.add(print); -// JMenuItem printPDF = new JMenuItem("PDF Print"); -// printPDF.addActionListener(new ActionListener(){ -// public void actionPerformed(ActionEvent e){ -// // lastGraphView.display.setHighQuality(true); -// ((AnchorGarden)RootWindow.this).pmenubar.mybar.setVisible(false); -// printPDF(canvas, "A4L", "ag2.pdf"); -// openPDF("ag2.pdf"); -// ((AnchorGarden)RootWindow.this).pmenubar.mybar.setVisible(true); -// } -// -// }); -// fileMenu.add(printPDF); - + // JMenuItem printPDF = new JMenuItem("PDF Print"); + // printPDF.addActionListener(new ActionListener(){ + // public void actionPerformed(ActionEvent e){ + // // lastGraphView.display.setHighQuality(true); + // ((AnchorGarden)RootWindow.this).pmenubar.mybar.setVisible(false); + // printPDF(canvas, "A4L", "ag2.pdf"); + // openPDF("ag2.pdf"); + // ((AnchorGarden)RootWindow.this).pmenubar.mybar.setVisible(true); + // } + // + // }); + // fileMenu.add(printPDF); JMenuItem exit = new JMenuItem("Exit"); - exit.addActionListener(new ActionListener(){ + exit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { - if (JOptionPane.showConfirmDialog(RootWindow.this.frame, "本当に全部終了してよろしいですか?", "確認", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION){ - System.exit(0); - } - } + // if (JOptionPane.showConfirmDialog(RootWindow.this.frame, "本当に全部終了してよろしいですか?", + // "確認", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION){ + System.exit(0); + // } + } }); fileMenu.add(exit); windowMenu = new JMenu("Window"); JMenuItem fit = new JMenuItem("Fit"); - fit.addActionListener(new ActionListener(){ + fit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { canvas.cam.animateViewToCenterBounds( buffer.layer.getUnionOfChildrenBounds(new PBounds()), true, 1000); - } + } }); windowMenu.add(fit); final JCheckBoxMenuItem full = new JCheckBoxMenuItem("Full Screen"); - full.addItemListener(new ItemListener(){ + full.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent arg0) { - frame.setFullScreenMode(full.isSelected()); + frame.setFullScreenMode(full.isSelected()); } }); windowMenu.add(full); @@ -269,28 +281,26 @@ extraMenu = new JMenu("Extra"); menuBar.add(extraMenu); - isAutoMode = new JCheckBoxMenuItem("Automatic Variable Name"); - isAutoMode.addItemListener(new ItemListener(){ - public void itemStateChanged(ItemEvent arg0){ + isAutoMode.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent arg0) { } }); isAutoMode.setSelected(true); - // isAutoMode.setSelected(false); + // isAutoMode.setSelected(false); extraMenu.add(isAutoMode); - isAutoMode_obj = new JCheckBoxMenuItem("Automatic Constructor"); - isAutoMode_obj.addItemListener(new ItemListener(){ - public void itemStateChanged(ItemEvent arg0){ + isAutoMode_obj.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent arg0) { } }); isAutoMode_obj.setSelected(true); - // isAutoMode.setSelected(false); + // isAutoMode.setSelected(false); extraMenu.add(isAutoMode_obj); final JMenuItem srcWin = new JMenuItem("Source Code"); - srcWin.addActionListener(new ActionListener(){ + srcWin.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { showSrcWin(true); } @@ -300,13 +310,13 @@ extraMenu.addSeparator(); JMenuItem[] modeMI = new JMenuItem[ClassFieldMenu.modes.length]; - for(int i=0;i paperSizeHash = new Hashtable(); -// paperSizeHash.put("A0L", PageSize.A0.rotate()); -// paperSizeHash.put("A1L", PageSize.A1.rotate()); -// paperSizeHash.put("A2L", PageSize.A2.rotate()); -// paperSizeHash.put("A3L", PageSize.A3.rotate()); -// paperSizeHash.put("A4L", PageSize.A4.rotate()); -// paperSizeHash.put("A0P", PageSize.A0); -// paperSizeHash.put("A1P", PageSize.A1); -// paperSizeHash.put("A2P", PageSize.A2); -// paperSizeHash.put("A3P", PageSize.A3); -// paperSizeHash.put("A4P", PageSize.A4); -// paperSizeHash.put("A0", PageSize.A0); -// paperSizeHash.put("A1", PageSize.A1); -// paperSizeHash.put("A2", PageSize.A2); -// paperSizeHash.put("A3", PageSize.A3); -// paperSizeHash.put("A4", PageSize.A4); -// -// Document document = new Document(new Rectangle(0,0,canvas.getWidth(),canvas.getHeight()), 0, 0, 0, 0); -// System.out.println("f "+frame.getWidth()+" "+frame.getHeight()); -// System.out.println("c "+canvas.getWidth()+" "+canvas.getHeight()); -// // Document document = new Document(new Rectangle(0,0,frame.getWidth()-16,frame.getHeight()-60), 0, 0, 0, 0); -// // step 2: creation of the writer -// PdfWriter writer = null; -// try { -// writer = PdfWriter.getInstance(document, new FileOutputStream(outfilename)); -// // writer.setPdfVersion(PdfWriter.VERSION_1_7); -// } catch (FileNotFoundException e) { -// e.printStackTrace(); -// } catch (DocumentException e) { -// e.printStackTrace(); -// } -// -// // step 3: we open the document -// document.open(); -// -// // step 4: we grab the ContentByte and do some stuff with it -// -// // we create a fontMapper and read all the fonts in the font directory -// DefaultFontMapper mapper = new DefaultFontMapper(); -// FontFactory.registerDirectories(); -// mapper.insertDirectory("c:\\windows\\fonts"); -// // we create a template and a Graphics2D object that corresponds with it -// PdfContentByte cb = writer.getDirectContent(); -// -// Graphics2D g2 = cb.createGraphicsShapes(canvas.getWidth(), canvas.getHeight()); -// -// // System.out.println(pagesizeString+" "+paperSizeHash.get(pagesizeString).getWidth()+" "+paperSizeHash.get(pagesizeString).getHeight()); -// // canvas.paintDisplay(g2, new Dimension(3000,2000)); -// canvas.paint(g2); -// -// g2.dispose(); -// -// // step 5: we close the document -// document.close(); -// } + // public void printPDF(PCanvas canvas, String pagesizeString, String + // outfilename) { + // Hashtable paperSizeHash = new + // Hashtable(); + // paperSizeHash.put("A0L", PageSize.A0.rotate()); + // paperSizeHash.put("A1L", PageSize.A1.rotate()); + // paperSizeHash.put("A2L", PageSize.A2.rotate()); + // paperSizeHash.put("A3L", PageSize.A3.rotate()); + // paperSizeHash.put("A4L", PageSize.A4.rotate()); + // paperSizeHash.put("A0P", PageSize.A0); + // paperSizeHash.put("A1P", PageSize.A1); + // paperSizeHash.put("A2P", PageSize.A2); + // paperSizeHash.put("A3P", PageSize.A3); + // paperSizeHash.put("A4P", PageSize.A4); + // paperSizeHash.put("A0", PageSize.A0); + // paperSizeHash.put("A1", PageSize.A1); + // paperSizeHash.put("A2", PageSize.A2); + // paperSizeHash.put("A3", PageSize.A3); + // paperSizeHash.put("A4", PageSize.A4); + // + // Document document = new Document(new + // Rectangle(0,0,canvas.getWidth(),canvas.getHeight()), 0, 0, 0, 0); + // System.out.println("f "+frame.getWidth()+" "+frame.getHeight()); + // System.out.println("c "+canvas.getWidth()+" "+canvas.getHeight()); + // // Document document = new Document(new + // Rectangle(0,0,frame.getWidth()-16,frame.getHeight()-60), 0, 0, 0, 0); + // // step 2: creation of the writer + // PdfWriter writer = null; + // try { + // writer = PdfWriter.getInstance(document, new FileOutputStream(outfilename)); + // // writer.setPdfVersion(PdfWriter.VERSION_1_7); + // } catch (FileNotFoundException e) { + // e.printStackTrace(); + // } catch (DocumentException e) { + // e.printStackTrace(); + // } + // + // // step 3: we open the document + // document.open(); + // + // // step 4: we grab the ContentByte and do some stuff with it + // + // // we create a fontMapper and read all the fonts in the font directory + // DefaultFontMapper mapper = new DefaultFontMapper(); + // FontFactory.registerDirectories(); + // mapper.insertDirectory("c:\\windows\\fonts"); + // // we create a template and a Graphics2D object that corresponds with it + // PdfContentByte cb = writer.getDirectContent(); + // + // Graphics2D g2 = cb.createGraphicsShapes(canvas.getWidth(), + // canvas.getHeight()); + // + // // System.out.println(pagesizeString+" + // "+paperSizeHash.get(pagesizeString).getWidth()+" + // "+paperSizeHash.get(pagesizeString).getHeight()); + // // canvas.paintDisplay(g2, new Dimension(3000,2000)); + // canvas.paint(g2); + // + // g2.dispose(); + // + // // step 5: we close the document + // document.close(); + // } } - - diff --git a/src/main/java/jaist/css/covis/util/MyPCanvas.java b/src/main/java/jaist/css/covis/util/MyPCanvas.java index 1d24f15..2e59bd8 100644 --- a/src/main/java/jaist/css/covis/util/MyPCanvas.java +++ b/src/main/java/jaist/css/covis/util/MyPCanvas.java @@ -26,13 +26,13 @@ public class MyPCanvas extends PCanvas { static PInputEventFilter b1mask = new PInputEventFilter( - InputEvent.BUTTON1_DOWN_MASK); + InputEvent.BUTTON1_MASK); static PInputEventFilter b2mask = new PInputEventFilter( - InputEvent.BUTTON2_DOWN_MASK); + InputEvent.BUTTON2_MASK); static PInputEventFilter b3mask = new PInputEventFilter( - InputEvent.BUTTON3_DOWN_MASK); + InputEvent.BUTTON3_MASK); static PInputEventFilter disablemask = new PInputEventFilter(0);