Пример #1
0
 /**
  * Open a new window for this application containing the passed in drawing, or a new drawing if
  * the passed in drawing is null.
  */
 public void newWindow(Drawing initialDrawing) {
   DrawApplication window = createApplication();
   if (initialDrawing == null) {
     window.open();
   } else {
     window.open(createDrawingView(initialDrawing));
   }
 }
Пример #2
0
 /**
  * Open a new view for this application containing a view of the drawing of the currently
  * activated window.
  */
 public void newView() {
   if (view() == null) {
     return;
   }
   DrawApplication window = createApplication();
   window.open(view());
   if (view().drawing().getTitle() != null) {
     window.setDrawingTitle(view().drawing().getTitle() + " (View)");
   } else {
     window.setDrawingTitle(getDefaultDrawingTitle() + " (View)");
   }
 }
Пример #3
0
  protected void createTools(Panel palette) {
    super.createTools(palette);

    Tool tool = new TextTool(view(), new NodeFigure());
    palette.add(createToolButton(IMAGES + "TEXT", "Text Tool", tool));

    tool = new CreationTool(view(), new NodeFigure());
    palette.add(createToolButton(IMAGES + "RECT", "Create Org Unit", tool));

    tool = new ConnectionTool(view(), new LineConnection());
    palette.add(createToolButton(IMAGES + "CONN", "Connection Tool", tool));
  }
Пример #4
0
 public static void main(String[] args) {
   DrawApplication window = new NetApp();
   window.open();
 }