コード例 #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
ファイル: NetApp.java プロジェクト: Markonis/JPlanetarium
  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
ファイル: NetApp.java プロジェクト: Markonis/JPlanetarium
 public static void main(String[] args) {
   DrawApplication window = new NetApp();
   window.open();
 }