public JCheckBox getCheck() {
   if (check == null) {
     check = new JCheckBox();
     check.setPreferredSize(new java.awt.Dimension(20, 20));
   }
   return check;
 }
Example #2
0
  public CheckBoxMedida(NombreMedida nombreMedida) {

    super(nombreMedida.toString());
    this.nombreMedida = nombreMedida;
    super.setSelected(false);
    super.setSize(this.dimensionCheck);
    super.setMaximumSize(this.dimensionCheck);
    super.setMinimumSize(this.dimensionCheck);
    super.setPreferredSize(this.dimensionCheck);
  }
Example #3
0
  protected void addPostQueryCheckBox(JXToolBar toolbar) {
    postQueryCheckBox = new JCheckBox("Post QueryString", httpRequest.isPostQueryString());
    postQueryCheckBox.setToolTipText("Controls if Query-parameters should be put in message body");
    postQueryCheckBox.setOpaque(false);
    postQueryCheckBox.addItemListener(
        new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            httpRequest.setPostQueryString(postQueryCheckBox.isSelected());
            enableBodyComponents();
          }
        });

    postQueryCheckBox.setPreferredSize(new Dimension(130, 20));
    toolbar.addFixed(postQueryCheckBox);
  }
Example #4
0
 /* WARNING: THIS METHOD WILL BE REGENERATED. */
 private javax.swing.JCheckBox getDecompCheck() {
   if (ivjDecompCheck == null) {
     try {
       ivjDecompCheck = new javax.swing.JCheckBox();
       ivjDecompCheck.setName("DecompCheck");
       ivjDecompCheck.setSelected(true);
       ivjDecompCheck.setPreferredSize(new java.awt.Dimension(150, 20));
       ivjDecompCheck.setText("Use decomposition of residual correlation matrix");
       // user code begin {1}
       // user code end
     } catch (Throwable ivjExc) {
       // user code begin {2}
       // user code end
       handleException(ivjExc);
     }
   }
   return ivjDecompCheck;
 }
Example #5
0
 private void initGUI() {
   try {
     AnchorLayout thisLayout = new AnchorLayout();
     getContentPane().setLayout(thisLayout);
     {
       okcan = new OkayCancelPanel(false, false, this);
       getContentPane()
           .add(
               okcan,
               new AnchorConstraint(
                   833,
                   944,
                   957,
                   59,
                   AnchorConstraint.ANCHOR_REL,
                   AnchorConstraint.ANCHOR_REL,
                   AnchorConstraint.ANCHOR_REL,
                   AnchorConstraint.ANCHOR_REL));
     }
     /*{
     okay = new JButton();
     getContentPane().add(okay, new AnchorConstraint(833, 944, 957, 566, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
     okay.setText("OK");
     okay.setPreferredSize(new java.awt.Dimension(79, 31));
     }
     {
     cancel = new JButton();
     getContentPane().add(cancel, new AnchorConstraint(853, 471, 937, 59, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
     cancel.setText("Cancel");
     cancel.setPreferredSize(new java.awt.Dimension(86, 21));
     }*/
     {
       groupPanel = new JPanel();
       AnchorLayout groupPanelLayout = new AnchorLayout();
       getContentPane()
           .add(
               groupPanel,
               new AnchorConstraint(
                   50,
                   944,
                   785,
                   59,
                   AnchorConstraint.ANCHOR_REL,
                   AnchorConstraint.ANCHOR_REL,
                   AnchorConstraint.ANCHOR_REL,
                   AnchorConstraint.ANCHOR_REL));
       groupPanel.setPreferredSize(new java.awt.Dimension(185, 183));
       groupPanel.setLayout(groupPanelLayout);
       groupPanel.setBorder(BorderFactory.createTitledBorder("Contrast Type"));
       {
         custom = new JCheckBox();
         groupPanel.add(
             custom,
             new AnchorConstraint(
                 751,
                 916,
                 849,
                 218,
                 AnchorConstraint.ANCHOR_REL,
                 AnchorConstraint.ANCHOR_REL,
                 AnchorConstraint.ANCHOR_REL,
                 AnchorConstraint.ANCHOR_REL));
         custom.setText("Custom");
         custom.setPreferredSize(new java.awt.Dimension(129, 18));
       }
       {
         polynomial = new JCheckBox();
         groupPanel.add(
             polynomial,
             new AnchorConstraint(
                 614,
                 916,
                 713,
                 218,
                 AnchorConstraint.ANCHOR_REL,
                 AnchorConstraint.ANCHOR_REL,
                 AnchorConstraint.ANCHOR_REL,
                 AnchorConstraint.ANCHOR_REL));
         polynomial.setText("Polynomial");
         polynomial.setPreferredSize(new java.awt.Dimension(129, 18));
       }
       {
         helmert = new JCheckBox();
         groupPanel.add(
             helmert,
             new AnchorConstraint(
                 483,
                 916,
                 576,
                 218,
                 AnchorConstraint.ANCHOR_REL,
                 AnchorConstraint.ANCHOR_REL,
                 AnchorConstraint.ANCHOR_REL,
                 AnchorConstraint.ANCHOR_REL));
         helmert.setText("Helment");
         helmert.setPreferredSize(new java.awt.Dimension(129, 17));
       }
       {
         sum = new JCheckBox();
         groupPanel.add(
             sum,
             new AnchorConstraint(
                 346,
                 916,
                 445,
                 218,
                 AnchorConstraint.ANCHOR_REL,
                 AnchorConstraint.ANCHOR_REL,
                 AnchorConstraint.ANCHOR_REL,
                 AnchorConstraint.ANCHOR_REL));
         sum.setText("Sum (Deviation)");
         sum.setPreferredSize(new java.awt.Dimension(129, 18));
       }
       {
         treatment = new JCheckBox();
         groupPanel.add(
             treatment,
             new AnchorConstraint(
                 210,
                 916,
                 308,
                 218,
                 AnchorConstraint.ANCHOR_REL,
                 AnchorConstraint.ANCHOR_REL,
                 AnchorConstraint.ANCHOR_REL,
                 AnchorConstraint.ANCHOR_REL));
         treatment.setText("Treatment");
         treatment.setPreferredSize(new java.awt.Dimension(129, 18));
       }
     }
     buttonGroup1 = new ButtonGroup();
     buttonGroup1.add(treatment);
     buttonGroup1.add(helmert);
     buttonGroup1.add(sum);
     buttonGroup1.add(polynomial);
     buttonGroup1.add(custom);
     treatment.addActionListener(this);
     helmert.addActionListener(this);
     sum.addActionListener(this);
     polynomial.addActionListener(this);
     custom.addActionListener(this);
     // TODO: add custom logic
     custom.setVisible(false);
     this.setSize(217, 283);
   } catch (Exception e) {
     new ErrorMsg(e);
   }
 }
Example #6
0
 private Map<Flag, JCheckBox> computeFlagCheckMap() {
   Map<Flag, JCheckBox> result = new EnumMap<Flag, JCheckBox>(Flag.class);
   for (Flag flag : Flag.values()) {
     String text = null;
     String tip = null;
     switch (flag) {
       case FINAL:
         text = "Mark final states with:";
         tip = "If ticked, all final states will be labelled";
         break;
       case NUMBER:
         text = "Number all states with:";
         tip =
             String.format(
                 "If ticked, all states will be labelled, with '%s' replaced by the state number",
                 PLACEHOLDER);
         break;
       case TRANSIENT:
         text = "Mark transient states with:";
         tip =
             String.format(
                 "If ticked, transient states will be labelled, "
                     + "with '%s' replaced by the transient depth",
                 PLACEHOLDER);
         break;
       case OPEN:
         text = "Mark open states with:";
         tip = "If ticked, all open states will be labelled";
         break;
       case RESULT:
         text = "Mark result states with:";
         tip = "If ticked, all result states will be labelled";
         break;
       case RECIPE:
         text = "Mark recipe stages with:";
         tip =
             String.format(
                 "If ticked, recipe stages will included and optionally labelled, "
                     + "with '%s' replaced by the recipe name",
                 PLACEHOLDER);
         break;
       case START:
         text = "Mark start state with:";
         tip = "If ticked, the start state will be labelled";
         break;
       default:
         assert false;
     }
     final JCheckBox checkBox = new JCheckBox(text);
     checkBox.setPreferredSize(LARGE_LEFT);
     checkBox.setToolTipText(tip);
     final JTextField textField = getFlagTextField(flag);
     checkBox.addChangeListener(
         new ChangeListener() {
           @Override
           public void stateChanged(ChangeEvent e) {
             textField.setEnabled(checkBox.isSelected());
             textField.setEditable(checkBox.isSelected());
           }
         });
     checkBox.setSelected(LTSLabels.DEFAULT.hasFlag(flag));
     result.put(flag, checkBox);
   }
   return result;
 }
  public AttributesEditionPanel(
      final Component parent,
      final DiagramManager diagramManager,
      final ClassElement classElement,
      final Classifier element) {
    this.diagramManager = diagramManager;
    this.classElement = classElement;
    this.element = element;
    this.parent = parent;

    attributesTableModel = new AttributeTableModel(element);

    panel = new JPanel();
    panel.setBorder(BorderFactory.createTitledBorder(""));

    GroupLayout groupLayout = new GroupLayout(this);
    groupLayout.setHorizontalGroup(
        groupLayout
            .createParallelGroup(Alignment.LEADING)
            .addComponent(panel, GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE));
    groupLayout.setVerticalGroup(
        groupLayout
            .createParallelGroup(Alignment.LEADING)
            .addComponent(panel, GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE));

    scrollpane = new JScrollPane();
    scrollpane.setMinimumSize(new Dimension(0, 0));
    scrollpane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    scrollpane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    scrollpane.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));

    table = new JTable();
    scrollpane.setViewportView(table);
    table.setModel(attributesTableModel);

    table.setBorder(new EmptyBorder(0, 0, 0, 0));
    table.setFillsViewportHeight(true);
    table.setGridColor(Color.LIGHT_GRAY);
    table.setSelectionBackground(ColorPalette.getInstance().getColor(ThemeColor.GREEN_MEDIUM));
    table.setSelectionForeground(Color.BLACK);
    table.setFocusable(false);
    table.setRowHeight(23);

    btnCreate = new JButton("");
    btnCreate.setFocusable(false);
    btnCreate.setToolTipText("Add new attribute to this class");
    btnCreate.setIcon(
        new ImageIcon(AttributesEditionPanel.class.getResource("/resources/icons/x16/new.png")));
    btnCreate.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent arg0) {
            addAttribute(arg0);
          }
        });

    btnDelete = new JButton("");
    btnDelete.setFocusable(false);
    btnDelete.setToolTipText("Delete selected attribute");
    btnDelete.setIcon(
        new ImageIcon(AttributesEditionPanel.class.getResource("/resources/icons/x16/cross.png")));
    btnDelete.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent arg0) {
            deleteAttribute(arg0);
          }
        });

    btnUp = new JButton("");
    btnUp.setFocusable(false);
    btnUp.setToolTipText("Move up selected attribute");
    btnUp.setIcon(
        new ImageIcon(
            AttributesEditionPanel.class.getResource("/resources/icons/x16/arrow_up.png")));
    btnUp.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent arg0) {
            moveUpAttribute();
          }
        });

    btnDown = new JButton("");
    btnDown.setFocusable(false);
    btnDown.setToolTipText("Move down selected attribute");
    btnDown.setIcon(
        new ImageIcon(
            AttributesEditionPanel.class.getResource("/resources/icons/x16/arrow_down.png")));
    btnDown.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent arg0) {
            moveDownAttribute();
          }
        });

    btnEdit = new JButton("");
    btnEdit.setEnabled(true);
    btnEdit.setFocusable(false);
    btnEdit.setToolTipText("Edit selected attribute");
    btnEdit.setIcon(
        new ImageIcon(AttributesEditionPanel.class.getResource("/resources/icons/x16/pencil.png")));
    btnEdit.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent arg0) {
            int row = table.getSelectedRow();
            if (row >= 0) {
              Property p = attributesTableModel.getEntry(row);
              if (parent instanceof JFrame) {
                AttributeDialog dialog =
                    new AttributeDialog(
                        (JFrame) parent, diagramManager, classElement, element, p, false);
                dialog.setLocationRelativeTo(parent);
                dialog.setVisible(true);
              } else if (parent instanceof JDialog) {
                AttributeDialog dialog =
                    new AttributeDialog(
                        (JDialog) parent, diagramManager, classElement, element, p, false);
                dialog.setLocationRelativeTo(parent);
                dialog.setVisible(true);
              }
            }
          }
        });

    cbxVisible = new JCheckBox("Turn attributes visible");
    cbxVisible.setPreferredSize(new Dimension(140, 20));
    cbxVisible.setHorizontalAlignment(SwingConstants.LEFT);

    GroupLayout gl_panel = new GroupLayout(panel);
    gl_panel.setHorizontalGroup(
        gl_panel
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                Alignment.TRAILING,
                gl_panel
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        gl_panel
                            .createParallelGroup(Alignment.TRAILING)
                            .addComponent(
                                scrollpane,
                                Alignment.LEADING,
                                GroupLayout.DEFAULT_SIZE,
                                426,
                                Short.MAX_VALUE)
                            .addGroup(
                                gl_panel
                                    .createSequentialGroup()
                                    .addComponent(
                                        btnUp,
                                        GroupLayout.PREFERRED_SIZE,
                                        32,
                                        GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addComponent(
                                        btnDown,
                                        GroupLayout.PREFERRED_SIZE,
                                        32,
                                        GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addComponent(
                                        cbxVisible, GroupLayout.DEFAULT_SIZE, 236, Short.MAX_VALUE)
                                    .addGap(10)
                                    .addComponent(
                                        btnCreate,
                                        GroupLayout.PREFERRED_SIZE,
                                        32,
                                        GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addComponent(
                                        btnDelete,
                                        GroupLayout.PREFERRED_SIZE,
                                        32,
                                        GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addComponent(
                                        btnEdit,
                                        GroupLayout.PREFERRED_SIZE,
                                        32,
                                        GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));
    gl_panel.setVerticalGroup(
        gl_panel
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                gl_panel
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        gl_panel
                            .createParallelGroup(Alignment.LEADING)
                            .addComponent(
                                btnDown, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                btnUp, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                cbxVisible,
                                GroupLayout.PREFERRED_SIZE,
                                32,
                                GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                btnCreate,
                                GroupLayout.PREFERRED_SIZE,
                                32,
                                GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                btnDelete,
                                GroupLayout.PREFERRED_SIZE,
                                32,
                                GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                btnEdit,
                                GroupLayout.PREFERRED_SIZE,
                                32,
                                GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(scrollpane, GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE)
                    .addGap(10)));
    panel.setLayout(gl_panel);
    this.setLayout(groupLayout);

    setSize(450, 221);

    if (classElement != null) {
      cbxVisible.setSelected(classElement.showAttributes());
      cbxVisible.setEnabled(true);
    } else {
      cbxVisible.setSelected(false);
      cbxVisible.setEnabled(false);
    }

    myPostInit();
  }