Ejemplo n.º 1
0
 void setTool(Tool tool) {
   // Default to the view tool
   if (tool == null) {
     tool = tools[0];
   }
   // Connect this tool to the preview panel's mouse and keyboard handlers
   preview.setTool(tool);
   // Set the tool title
   titleLabel.setText(tool.getTitle());
   // Set tool instructions
   infoLabel.setText(tool.getInstructions());
   // Add subpanel
   if (toolControls != null) {
     subPanel.remove(toolControls);
   }
   toolControls = tool.getControls();
   if (toolControls != null) {
     subPanel.add(toolControls, "spanx,spany,growx,growy,width 100%");
   } else {
   }
   validate();
   repaint();
 }
Ejemplo n.º 2
0
 EditingModel getModel() {
   return preview.getModel();
 }