コード例 #1
0
ファイル: DrawApplet.java プロジェクト: RoDaniel/featurehouse
 protected void createAttributeChoices(JPanel panel) {
   panel.add(new JLabel("Fill"));
   fFillColor = createColorChoice(FigureAttributeConstant.FILL_COLOR);
   panel.add(fFillColor);
   panel.add(new JLabel("Text"));
   fTextColor = createColorChoice(FigureAttributeConstant.TEXT_COLOR);
   panel.add(fTextColor);
   panel.add(new JLabel("Pen"));
   fFrameColor = createColorChoice(FigureAttributeConstant.FRAME_COLOR);
   panel.add(fFrameColor);
   panel.add(new JLabel("Arrow"));
   CommandChoice choice = new CommandChoice();
   fArrowChoice = choice;
   FigureAttributeConstant arrowMode = FigureAttributeConstant.ARROW_MODE;
   choice.addItem(
       new ChangeAttributeCommand(
           "none", arrowMode, new Integer(PolyLineFigure.ARROW_TIP_NONE), this));
   choice.addItem(
       new ChangeAttributeCommand(
           "at Start", arrowMode, new Integer(PolyLineFigure.ARROW_TIP_START), this));
   choice.addItem(
       new ChangeAttributeCommand(
           "at End", arrowMode, new Integer(PolyLineFigure.ARROW_TIP_END), this));
   choice.addItem(
       new ChangeAttributeCommand(
           "at Both", arrowMode, new Integer(PolyLineFigure.ARROW_TIP_BOTH), this));
   panel.add(fArrowChoice);
   panel.add(new JLabel("Font"));
   fFontChoice = createFontChoice();
   panel.add(fFontChoice);
 }
コード例 #2
0
ファイル: DrawApplet.java プロジェクト: RoDaniel/featurehouse
 protected void createButtons(JPanel panel) {
   panel.add(new Filler(24, 20));
   JComboBox drawingChoice = new JComboBox();
   drawingChoice.addItem(fgUntitled);
   String param = getParameter("DRAWINGS");
   if (param == null) {
     param = "";
   }
   StringTokenizer st = new StringTokenizer(param);
   while (st.hasMoreTokens()) {
     drawingChoice.addItem(st.nextToken());
   }
   if (drawingChoice.getItemCount() > 1) {
     panel.add(drawingChoice);
   } else {
     panel.add(new JLabel(fgUntitled));
   }
   drawingChoice.addItemListener(
       new ItemListener() {
         public void itemStateChanged(ItemEvent e) {
           if (e.getStateChange() == ItemEvent.SELECTED) {
             loadDrawing((String) e.getItem());
           }
         }
       });
   panel.add(new Filler(6, 20));
   JButton button;
   button = new CommandButton(new DeleteCommand("Delete", this));
   panel.add(button);
   button = new CommandButton(new DuplicateCommand("Duplicate", this));
   panel.add(button);
   button = new CommandButton(new GroupCommand("Group", this));
   panel.add(button);
   button = new CommandButton(new UngroupCommand("Ungroup", this));
   panel.add(button);
   button = new JButton("Help");
   button.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent event) {
           showHelp();
         }
       });
   panel.add(button);
   fUpdateButton = new JButton("Simple Update");
   fUpdateButton.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent event) {
           if (fSimpleUpdate) {
             setBufferedDisplayUpdate();
           } else {
             setSimpleDisplayUpdate();
           }
         }
       });
 }
コード例 #3
0
ファイル: DrawApplet.java プロジェクト: RoDaniel/featurehouse
 protected JPanel createAttributesPanel() {
   JPanel panel = new JPanel();
   panel.setLayout(new PaletteLayout(2, new Point(2, 2), false));
   return panel;
 }
コード例 #4
0
ファイル: DrawApplet.java プロジェクト: RoDaniel/featurehouse
 protected void createTools(JPanel palette) {
   Tool tool = createSelectionTool();
   fDefaultToolButton = createToolButton(IMAGES + "SEL", "Selection Tool", tool);
   palette.add(fDefaultToolButton);
 }
コード例 #5
0
ファイル: DrawApplet.java プロジェクト: RoDaniel/featurehouse
 protected JPanel createToolPalette() {
   JPanel palette = new JPanel();
   palette.setLayout(new PaletteLayout(2, new Point(2, 2)));
   return palette;
 }