Пример #1
0
  private void createIdField() {
    idFieldPanel = new JPanel();

    idFieldPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));

    idFieldPanel.add(new JLabel(TLanguage.getString("TTextAreaDialog.ID")));

    idTextField = new TIdTextField();
    idFieldPanel.add(idTextField);

    idTextField.setText(TBoardConstants.getId(getAttributeMap()));
  }
Пример #2
0
  /* (non-Javadoc)
   * @see tico.editor.dialogs.TComponentDialog#newComponentsAttributeMap()
   */
  protected Map newComponentsAttributeMap() {
    Map nested = new Hashtable();
    Map attributeMap = new Hashtable();
    Vector removalAttributes = new Vector();

    TBoardConstants.setText(attributeMap, textField.getText());

    TBoardConstants.setForeground(attributeMap, fontModel.getFontColor());
    TBoardConstants.setFont(
        attributeMap,
        new Font(fontModel.getFontFace(), fontModel.getFontStyle(), fontModel.getFontSize()));

    TBoardConstants.setHorizontalAlignment(
        attributeMap, textAlignSelectorPanel.getHorizontalAlignment());
    TBoardConstants.setVerticalAlignment(
        attributeMap, textAlignSelectorPanel.getVerticalAlignment());

    Color color = borderSelectionPanel.getBorderColor();
    if (color != null) TBoardConstants.setBorderColor(attributeMap, color);
    else removalAttributes.add(TBoardConstants.BORDERCOLOR);

    TBoardConstants.setLineWidth(attributeMap, borderSelectionPanel.getBorderSize());

    Color background = backgroundSelectionPanel.getBackgroundColor();
    if (background != null) TBoardConstants.setBackground(attributeMap, background);
    else removalAttributes.add(TBoardConstants.BACKGROUND);

    Color gradient = backgroundSelectionPanel.getGradientColor();
    if (gradient != null) TBoardConstants.setGradientColor(attributeMap, gradient);
    else removalAttributes.add(TBoardConstants.GRADIENTCOLOR);

    TBoardConstants.setRemoveAttributes(attributeMap, removalAttributes.toArray());

    TBoardConstants.setId(attributeMap, idTextField.getText());

    nested.put(getComponent(), attributeMap);

    return nested;
  }