Exemple #1
0
  private void createTextAlignSelector() {
    Map map = getAttributeMap();

    textAlignSelectorPanel = new TTextAlignSelectorPanel();

    textAlignSelectorPanel.setHorizontalAlignment(TBoardConstants.getHorizontalAlignment(map));
    textAlignSelectorPanel.setVerticalAlignment(TBoardConstants.getVerticalAlignment(map));
  }
Exemple #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;
  }