0001: /*
0002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
0003: *
0004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
0005: *
0006: * The contents of this file are subject to the terms of either the GNU
0007: * General Public License Version 2 only ("GPL") or the Common
0008: * Development and Distribution License("CDDL") (collectively, the
0009: * "License"). You may not use this file except in compliance with the
0010: * License. You can obtain a copy of the License at
0011: * http://www.netbeans.org/cddl-gplv2.html
0012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
0013: * specific language governing permissions and limitations under the
0014: * License. When distributing the software, include this License Header
0015: * Notice in each file and include the License file at
0016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
0017: * particular file as subject to the "Classpath" exception as provided
0018: * by Sun in the GPL Version 2 section of the License file that
0019: * accompanied this code. If applicable, add the following below the
0020: * License Header, with the fields enclosed by brackets [] replaced by
0021: * your own identifying information:
0022: * "Portions Copyrighted [year] [name of copyright owner]"
0023: *
0024: * Contributor(s):
0025: *
0026: * The Original Software is NetBeans. The Initial Developer of the Original
0027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
0028: * Microsystems, Inc. All Rights Reserved.
0029: *
0030: * If you wish your version of this file to be governed by only the CDDL
0031: * or only the GPL Version 2, indicate your decision by adding
0032: * "[Contributor] elects to include this software in this distribution
0033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
0034: * single choice of license, a recipient has the option to distribute
0035: * your version of this file under either the CDDL, the GPL Version 2 or
0036: * to extend the choice of license to its licensees as provided above.
0037: * However, if you add GPL Version 2 code and therefore, elected the GPL
0038: * Version 2 license, then the option applies only if the new code is
0039: * made subject to such option by the copyright holder.
0040: */
0041: package org.netbeans.modules.visualweb.propertyeditors.css;
0042:
0043: import org.netbeans.modules.visualweb.propertyeditors.css.model.ClipData;
0044: import org.netbeans.modules.visualweb.propertyeditors.css.model.ClipModel;
0045: import org.netbeans.modules.visualweb.propertyeditors.css.model.CssStyleData;
0046: import org.netbeans.modules.visualweb.propertyeditors.css.model.PositionData;
0047: import org.netbeans.modules.visualweb.propertyeditors.css.model.PositionModel;
0048: import org.netbeans.modules.visualweb.propertyeditors.css.model.PropertyData;
0049: import org.netbeans.modules.visualweb.propertyeditors.css.model.PropertyWithUnitData;
0050: import org.netbeans.modules.visualweb.propertyeditors.css.model.Utils;
0051: import java.awt.event.FocusAdapter;
0052: import java.awt.event.FocusEvent;
0053: import javax.swing.DefaultComboBoxModel;
0054: import javax.swing.Icon;
0055: import javax.swing.JPanel;
0056: import javax.swing.JTextField;
0057: import javax.swing.SwingUtilities;
0058: import org.openide.util.NbBundle;
0059:
0060: /**
0061: * Position Style editor.
0062: * @author Winston Prakash
0063: * Jeff Hoffman (HIE design)
0064: */
0065: public class PositionStyleEditor extends StyleEditor {
0066: CssStyleData cssStyleData = null;
0067:
0068: /** Creates new form FontStyleEditor */
0069: public PositionStyleEditor(CssStyleData styleData) {
0070: cssStyleData = styleData;
0071: setName("positionStyleEditor"); //NOI18N
0072: setDisplayName(NbBundle.getMessage(StyleBuilderDialog.class,
0073: "POSITION_EDITOR_DISPNAME"));
0074: initComponents();
0075: initialize();
0076:
0077: // Add editor listeners to the width & height combobox
0078: final JTextField widthComboBoxEditor = (JTextField) widthComboBox
0079: .getEditor().getEditorComponent();
0080: widthComboBoxEditor
0081: .addKeyListener(new java.awt.event.KeyAdapter() {
0082: public void keyTyped(java.awt.event.KeyEvent evt) {
0083: SwingUtilities.invokeLater(new Runnable() {
0084: public void run() {
0085: widthUnitComboBox.setEnabled(Utils
0086: .isInteger(widthComboBoxEditor
0087: .getText()));
0088: }
0089: });
0090: }
0091: });
0092: final JTextField heightComboBoxEditor = (JTextField) heightComboBox
0093: .getEditor().getEditorComponent();
0094: heightComboBoxEditor
0095: .addKeyListener(new java.awt.event.KeyAdapter() {
0096: public void keyTyped(java.awt.event.KeyEvent evt) {
0097: SwingUtilities.invokeLater(new Runnable() {
0098: public void run() {
0099: heightUnitComboBox.setEnabled(Utils
0100: .isInteger(heightComboBoxEditor
0101: .getText()));
0102: }
0103: });
0104: }
0105: });
0106:
0107: // Add editor listeners to the top, right, bottom & left combobox
0108:
0109: final JTextField posTopComboBoxEditor = (JTextField) posTopComboBox
0110: .getEditor().getEditorComponent();
0111: posTopComboBoxEditor
0112: .addKeyListener(new java.awt.event.KeyAdapter() {
0113: public void keyTyped(java.awt.event.KeyEvent evt) {
0114: SwingUtilities.invokeLater(new Runnable() {
0115: public void run() {
0116: posTopUnitComboBox.setEnabled(Utils
0117: .isInteger(posTopComboBoxEditor
0118: .getText()));
0119: }
0120: });
0121: }
0122: });
0123: final JTextField posRightComboBoxEditor = (JTextField) posRightComboBox
0124: .getEditor().getEditorComponent();
0125: posRightComboBoxEditor
0126: .addKeyListener(new java.awt.event.KeyAdapter() {
0127: public void keyTyped(java.awt.event.KeyEvent evt) {
0128: SwingUtilities.invokeLater(new Runnable() {
0129: public void run() {
0130: posRightUnitComboBox
0131: .setEnabled(Utils
0132: .isInteger(posRightComboBoxEditor
0133: .getText()));
0134: }
0135: });
0136: }
0137: });
0138: final JTextField posBottomComboBoxEditor = (JTextField) posBottomComboBox
0139: .getEditor().getEditorComponent();
0140: posBottomComboBoxEditor
0141: .addKeyListener(new java.awt.event.KeyAdapter() {
0142: public void keyTyped(java.awt.event.KeyEvent evt) {
0143: SwingUtilities.invokeLater(new Runnable() {
0144: public void run() {
0145: posBottomUnitComboBox
0146: .setEnabled(Utils
0147: .isInteger(posBottomComboBoxEditor
0148: .getText()));
0149: }
0150: });
0151: }
0152: });
0153: final JTextField posLeftComboBoxEditor = (JTextField) posLeftComboBox
0154: .getEditor().getEditorComponent();
0155: posLeftComboBoxEditor
0156: .addKeyListener(new java.awt.event.KeyAdapter() {
0157: public void keyTyped(java.awt.event.KeyEvent evt) {
0158: SwingUtilities.invokeLater(new Runnable() {
0159: public void run() {
0160: posLeftUnitComboBox
0161: .setEnabled(Utils
0162: .isInteger(posLeftComboBoxEditor
0163: .getText()));
0164: }
0165: });
0166:
0167: }
0168: });
0169:
0170: // Add editor listeners to the top, right, bottom & left Clip combobox
0171:
0172: final JTextField clipTopComboBoxEditor = (JTextField) clipTopComboBox
0173: .getEditor().getEditorComponent();
0174: clipTopComboBoxEditor
0175: .addKeyListener(new java.awt.event.KeyAdapter() {
0176: public void keyTyped(java.awt.event.KeyEvent evt) {
0177: SwingUtilities.invokeLater(new Runnable() {
0178: public void run() {
0179: clipTopUnitComboBox
0180: .setEnabled(Utils
0181: .isInteger(clipTopComboBoxEditor
0182: .getText()));
0183: }
0184: });
0185: }
0186: });
0187: final JTextField clipRightComboBoxEditor = (JTextField) clipRightComboBox
0188: .getEditor().getEditorComponent();
0189: clipRightComboBoxEditor
0190: .addKeyListener(new java.awt.event.KeyAdapter() {
0191: public void keyTyped(java.awt.event.KeyEvent evt) {
0192: SwingUtilities.invokeLater(new Runnable() {
0193: public void run() {
0194: clipRightUnitComboBox
0195: .setEnabled(Utils
0196: .isInteger(clipRightComboBoxEditor
0197: .getText()));
0198: }
0199: });
0200: }
0201: });
0202: final JTextField clipBottomComboBoxEditor = (JTextField) clipBottomComboBox
0203: .getEditor().getEditorComponent();
0204: clipBottomComboBoxEditor
0205: .addKeyListener(new java.awt.event.KeyAdapter() {
0206: public void keyTyped(java.awt.event.KeyEvent evt) {
0207: SwingUtilities.invokeLater(new Runnable() {
0208: public void run() {
0209: clipBottomUnitComboBox
0210: .setEnabled(Utils
0211: .isInteger(clipBottomComboBoxEditor
0212: .getText()));
0213: }
0214: });
0215: }
0216: });
0217: final JTextField clipLeftComboBoxEditor = (JTextField) clipLeftComboBox
0218: .getEditor().getEditorComponent();
0219: clipLeftComboBoxEditor
0220: .addKeyListener(new java.awt.event.KeyAdapter() {
0221: public void keyTyped(java.awt.event.KeyEvent evt) {
0222: SwingUtilities.invokeLater(new Runnable() {
0223: public void run() {
0224: clipLeftComboBoxEditor
0225: .setEnabled(Utils
0226: .isInteger(clipLeftComboBoxEditor
0227: .getText()));
0228: }
0229: });
0230: }
0231: });
0232: }
0233:
0234: private void initialize() {
0235: PositionModel positionModel = new PositionModel();
0236: PositionData positionData = new PositionData();
0237:
0238: // Set the Position Mode to the GUI
0239: DefaultComboBoxModel positionModeList = positionModel
0240: .getModeList();
0241: positionModeCombo.setModel(positionModeList);
0242: String positionMode = cssStyleData
0243: .getProperty(CssStyleData.POSITION);
0244: if (positionMode != null) {
0245: positionModeCombo.setSelectedItem(positionMode);
0246: } else {
0247: positionModeCombo.setSelectedIndex(0);
0248: }
0249:
0250: // Set the Position Top to the GUI
0251: DefaultComboBoxModel posTopList = positionModel
0252: .getPositionList();
0253: posTopComboBox.setModel(posTopList);
0254: posTopUnitComboBox
0255: .setModel(positionModel.getPositionUnitList());
0256: String posTop = cssStyleData.getProperty(CssStyleData.TOP);
0257: if (posTop != null) {
0258: positionData.setTop(posTop);
0259: posTopComboBox.setSelectedItem(positionData.getTopValue());
0260: posTopUnitComboBox.setSelectedItem(positionData
0261: .getTopUnit());
0262: } else {
0263: posTopComboBox.setSelectedIndex(0);
0264: posTopUnitComboBox.setSelectedIndex(0);
0265: }
0266:
0267: // Set the Position Bottom to the GUI
0268: DefaultComboBoxModel posBottomList = positionModel
0269: .getPositionList();
0270: posBottomComboBox.setModel(posBottomList);
0271: posBottomUnitComboBox.setModel(positionModel
0272: .getPositionUnitList());
0273: String posBottom = cssStyleData
0274: .getProperty(CssStyleData.BOTTOM);
0275: if (posBottom != null) {
0276: positionData.setBottom(posBottom);
0277: posBottomComboBox.setSelectedItem(positionData
0278: .getBottomValue());
0279: posBottomUnitComboBox.setSelectedItem(positionData
0280: .getBottomUnit());
0281: } else {
0282: posBottomComboBox.setSelectedIndex(0);
0283: posBottomUnitComboBox.setSelectedIndex(0);
0284: }
0285:
0286: // Set the Position Left to the GUI
0287: DefaultComboBoxModel posLeftList = positionModel
0288: .getPositionList();
0289: posLeftComboBox.setModel(posLeftList);
0290: posLeftUnitComboBox.setModel(positionModel
0291: .getPositionUnitList());
0292: String posLeft = cssStyleData.getProperty(CssStyleData.LEFT);
0293: if (posLeft != null) {
0294: positionData.setLeft(posLeft);
0295: posLeftComboBox
0296: .setSelectedItem(positionData.getLeftValue());
0297: posLeftUnitComboBox.setSelectedItem(positionData
0298: .getLeftUnit());
0299: } else {
0300: posLeftComboBox.setSelectedIndex(0);
0301: posLeftUnitComboBox.setSelectedIndex(0);
0302: }
0303:
0304: // Set the Width to the GUI
0305: DefaultComboBoxModel widthList = positionModel.getSizeList();
0306: widthComboBox.setModel(widthList);
0307: widthUnitComboBox.setModel(positionModel.getPositionUnitList());
0308: String width = cssStyleData.getProperty(CssStyleData.WIDTH);
0309: if (width != null) {
0310: positionData.setWidth(width);
0311: widthComboBox.setSelectedItem(positionData.getWidthValue());
0312: widthUnitComboBox.setSelectedItem(positionData
0313: .getWidthUnit());
0314: } else {
0315: widthComboBox.setSelectedIndex(0);
0316: widthUnitComboBox.setSelectedIndex(0);
0317: }
0318:
0319: // Set the Height to the GUI
0320: DefaultComboBoxModel heightList = positionModel.getSizeList();
0321: heightComboBox.setModel(heightList);
0322: heightUnitComboBox
0323: .setModel(positionModel.getPositionUnitList());
0324: String height = cssStyleData.getProperty(CssStyleData.HEIGHT);
0325: if (height != null) {
0326: positionData.setHeight(height);
0327: heightComboBox.setSelectedItem(positionData
0328: .getHeightValue());
0329: heightUnitComboBox.setSelectedItem(positionData
0330: .getHeightUnit());
0331: } else {
0332: heightComboBox.setSelectedIndex(0);
0333: heightUnitComboBox.setSelectedIndex(0);
0334: }
0335:
0336: // Set the Visibility to the GUI
0337: DefaultComboBoxModel visibilityList = positionModel
0338: .getVisibilityList();
0339: visibleComboBox.setModel(visibilityList);
0340: String visibility = cssStyleData
0341: .getProperty(CssStyleData.VISIBILITY);
0342: if (visibility != null) {
0343: visibleComboBox.setSelectedItem(visibility);
0344: } else {
0345: visibleComboBox.setSelectedIndex(0);
0346: }
0347:
0348: // Set the Visibility to the GUI
0349: DefaultComboBoxModel zindexList = positionModel.getZIndexList();
0350: zindexComboBox.setModel(zindexList);
0351: String zindex = cssStyleData.getProperty(CssStyleData.Z_INDEX);
0352: if (zindex != null) {
0353: zindexComboBox.setSelectedItem(zindex);
0354: } else {
0355: zindexComboBox.setSelectedIndex(0);
0356: }
0357:
0358: // Set the Position Left to the GUI
0359: DefaultComboBoxModel posRightList = positionModel
0360: .getPositionList();
0361: posRightComboBox.setModel(posRightList);
0362: posRightUnitComboBox.setModel(positionModel
0363: .getPositionUnitList());
0364: String posRight = cssStyleData.getProperty(CssStyleData.RIGHT);
0365: if (posRight != null) {
0366: positionData.setRight(posRight);
0367: posRightComboBox.setSelectedItem(positionData
0368: .getRightValue());
0369: posRightUnitComboBox.setSelectedItem(positionData
0370: .getRightUnit());
0371: } else {
0372: posRightComboBox.setSelectedIndex(0);
0373: posRightUnitComboBox.setSelectedIndex(0);
0374: }
0375:
0376: ClipModel clipModel = new ClipModel();
0377: ClipData clipData = new ClipData();
0378:
0379: // Set the Position Top to the GUI
0380: clipTopComboBox.setModel(clipModel.getClipList());
0381: clipTopUnitComboBox.setModel(clipModel.getClipUnitList());
0382: clipBottomComboBox.setModel(clipModel.getClipList());
0383: clipBottomUnitComboBox.setModel(clipModel.getClipUnitList());
0384: clipLeftComboBox.setModel(clipModel.getClipList());
0385: clipLeftUnitComboBox.setModel(clipModel.getClipUnitList());
0386: clipRightComboBox.setModel(clipModel.getClipList());
0387: clipRightUnitComboBox.setModel(clipModel.getClipUnitList());
0388:
0389: String clip = cssStyleData.getProperty(CssStyleData.CLIP);
0390: if (clip != null) {
0391: clipData.setClip(clip);
0392: clipTopComboBox.setSelectedItem(clipData.getTopValue());
0393: clipTopUnitComboBox.setSelectedItem(clipData.getTopUnit());
0394: clipBottomComboBox.setSelectedItem(clipData
0395: .getBottomValue());
0396: clipBottomUnitComboBox.setSelectedItem(clipData
0397: .getBottomUnit());
0398: clipLeftComboBox.setSelectedItem(clipData.getLeftValue());
0399: clipLeftUnitComboBox
0400: .setSelectedItem(clipData.getLeftUnit());
0401: clipRightComboBox.setSelectedItem(clipData.getRightValue());
0402: clipRightUnitComboBox.setSelectedItem(clipData
0403: .getRightUnit());
0404: } else {
0405: clipTopComboBox.setSelectedIndex(0);
0406: clipTopUnitComboBox.setSelectedIndex(0);
0407: clipBottomComboBox.setSelectedIndex(0);
0408: clipBottomUnitComboBox.setSelectedIndex(0);
0409: clipLeftComboBox.setSelectedIndex(0);
0410: clipLeftUnitComboBox.setSelectedIndex(0);
0411: clipRightComboBox.setSelectedIndex(0);
0412: clipRightUnitComboBox.setSelectedIndex(0);
0413: }
0414:
0415: posTopComboBox.getEditor().getEditorComponent()
0416: .addFocusListener(new FocusAdapter() {
0417: public void focusGained(FocusEvent evt) {
0418: errorLabel
0419: .setText(CssStyleData.PREVIEW_NOT_SUPPORTED);
0420: }
0421:
0422: public void focusLost(FocusEvent evt) {
0423: errorLabel.setText("");
0424: }
0425: });
0426: posBottomComboBox.getEditor().getEditorComponent()
0427: .addFocusListener(new FocusAdapter() {
0428: public void focusGained(FocusEvent evt) {
0429: errorLabel
0430: .setText(CssStyleData.PREVIEW_NOT_SUPPORTED);
0431: }
0432:
0433: public void focusLost(FocusEvent evt) {
0434: errorLabel.setText("");
0435: }
0436: });
0437: posLeftComboBox.getEditor().getEditorComponent()
0438: .addFocusListener(new FocusAdapter() {
0439: public void focusGained(FocusEvent evt) {
0440: errorLabel
0441: .setText(CssStyleData.PREVIEW_NOT_SUPPORTED);
0442: }
0443:
0444: public void focusLost(FocusEvent evt) {
0445: errorLabel.setText("");
0446: }
0447: });
0448: posRightComboBox.getEditor().getEditorComponent()
0449: .addFocusListener(new FocusAdapter() {
0450: public void focusGained(FocusEvent evt) {
0451: errorLabel
0452: .setText(CssStyleData.PREVIEW_NOT_SUPPORTED);
0453: }
0454:
0455: public void focusLost(FocusEvent evt) {
0456: errorLabel.setText("");
0457: }
0458: });
0459:
0460: clipTopComboBox.getEditor().getEditorComponent()
0461: .addFocusListener(new FocusAdapter() {
0462: public void focusGained(FocusEvent evt) {
0463: errorLabel
0464: .setText(CssStyleData.PREVIEW_NOT_SUPPORTED);
0465: }
0466:
0467: public void focusLost(FocusEvent evt) {
0468: errorLabel.setText("");
0469: }
0470: });
0471: clipBottomComboBox.getEditor().getEditorComponent()
0472: .addFocusListener(new FocusAdapter() {
0473: public void focusGained(FocusEvent evt) {
0474: errorLabel
0475: .setText(CssStyleData.PREVIEW_NOT_SUPPORTED);
0476: }
0477:
0478: public void focusLost(FocusEvent evt) {
0479: errorLabel.setText("");
0480: }
0481: });
0482: clipLeftComboBox.getEditor().getEditorComponent()
0483: .addFocusListener(new FocusAdapter() {
0484: public void focusGained(FocusEvent evt) {
0485: errorLabel
0486: .setText(CssStyleData.PREVIEW_NOT_SUPPORTED);
0487: }
0488:
0489: public void focusLost(FocusEvent evt) {
0490: errorLabel.setText("");
0491: }
0492: });
0493: clipRightComboBox.getEditor().getEditorComponent()
0494: .addFocusListener(new FocusAdapter() {
0495: public void focusGained(FocusEvent evt) {
0496: errorLabel
0497: .setText(CssStyleData.PREVIEW_NOT_SUPPORTED);
0498: }
0499:
0500: public void focusLost(FocusEvent evt) {
0501: errorLabel.setText("");
0502: }
0503: });
0504: }
0505:
0506: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
0507: private void initComponents() {
0508: java.awt.GridBagConstraints gridBagConstraints;
0509:
0510: mainPositionPanel = new javax.swing.JPanel();
0511: positionPanel = new javax.swing.JPanel();
0512: positionModePanel = new javax.swing.JPanel();
0513: containerPanel = new javax.swing.JPanel();
0514: positionModeLabel = new javax.swing.JLabel();
0515: positionModeCombo = new javax.swing.JComboBox();
0516: fillPanel = new javax.swing.JPanel();
0517: positionContainerPanel = new javax.swing.JPanel();
0518: posTopLabel = new javax.swing.JLabel();
0519: posTopComboBox = new javax.swing.JComboBox();
0520: posTopUnitComboBox = new javax.swing.JComboBox();
0521: posBottomLabel1 = new javax.swing.JLabel();
0522: posBottomComboBox = new javax.swing.JComboBox();
0523: posBottomUnitComboBox = new javax.swing.JComboBox();
0524: posRightLabel = new javax.swing.JLabel();
0525: posRightComboBox = new javax.swing.JComboBox();
0526: posRightUnitComboBox = new javax.swing.JComboBox();
0527: posLeftLabel1 = new javax.swing.JLabel();
0528: posLeftComboBox = new javax.swing.JComboBox();
0529: posLeftUnitComboBox = new javax.swing.JComboBox();
0530: sizePanel = new javax.swing.JPanel();
0531: sizeContainerPanel = new javax.swing.JPanel();
0532: heightLabel = new javax.swing.JLabel();
0533: heightComboBox = new javax.swing.JComboBox();
0534: heightUnitComboBox = new javax.swing.JComboBox();
0535: widthLabel = new javax.swing.JLabel();
0536: widthComboBox = new javax.swing.JComboBox();
0537: widthUnitComboBox = new javax.swing.JComboBox();
0538: visibleLabel1 = new javax.swing.JLabel();
0539: visibleComboBox = new javax.swing.JComboBox();
0540: zIndexLabel1 = new javax.swing.JLabel();
0541: zindexComboBox = new javax.swing.JComboBox();
0542: clipPanel = new javax.swing.JPanel();
0543: clipContainerPanel = new javax.swing.JPanel();
0544: clipLeftLabel1 = new javax.swing.JLabel();
0545: clipBottomUnitComboBox = new javax.swing.JComboBox();
0546: clipLeftUnitComboBox = new javax.swing.JComboBox();
0547: clipTopLabel1 = new javax.swing.JLabel();
0548: clipLeftComboBox = new javax.swing.JComboBox();
0549: clipTopUnitComboBox = new javax.swing.JComboBox();
0550: clipRightLabel1 = new javax.swing.JLabel();
0551: clipBottomComboBox = new javax.swing.JComboBox();
0552: clipRightUnitComboBox = new javax.swing.JComboBox();
0553: clipBottomLabel = new javax.swing.JLabel();
0554: clipTopComboBox = new javax.swing.JComboBox();
0555: clipRightComboBox = new javax.swing.JComboBox();
0556: clipErrorPanel = new javax.swing.JPanel();
0557: clipErrorLabel = new javax.swing.JLabel();
0558: errorPanel = new javax.swing.JPanel();
0559: errorLabel = new javax.swing.JLabel();
0560:
0561: setLayout(new java.awt.BorderLayout());
0562:
0563: mainPositionPanel.setLayout(new java.awt.GridBagLayout());
0564:
0565: positionPanel
0566: .setBorder(javax.swing.BorderFactory
0567: .createTitledBorder(
0568: javax.swing.BorderFactory
0569: .createEmptyBorder(1, 1, 1, 1),
0570: org.openide.util.NbBundle.getMessage(
0571: PositionStyleEditor.class,
0572: "POSITION_LABEL"),
0573: javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
0574: javax.swing.border.TitledBorder.ABOVE_TOP)); // NOI18N
0575: positionPanel.setLayout(new java.awt.BorderLayout());
0576:
0577: positionModePanel.setBorder(javax.swing.BorderFactory
0578: .createEmptyBorder(5, 5, 5, 5));
0579: positionModePanel.setLayout(new java.awt.BorderLayout());
0580:
0581: containerPanel.setLayout(new java.awt.BorderLayout(5, 5));
0582:
0583: positionModeLabel.setText(org.openide.util.NbBundle.getMessage(
0584: PositionStyleEditor.class, "POSITION_MODE")); // NOI18N
0585: containerPanel.add(positionModeLabel,
0586: java.awt.BorderLayout.WEST);
0587:
0588: positionModeCombo
0589: .addItemListener(new java.awt.event.ItemListener() {
0590: public void itemStateChanged(
0591: java.awt.event.ItemEvent evt) {
0592: positionModeComboItemStateChanged(evt);
0593: }
0594: });
0595: containerPanel.add(positionModeCombo,
0596: java.awt.BorderLayout.CENTER);
0597: java.util.ResourceBundle bundle = java.util.ResourceBundle
0598: .getBundle("org/netbeans/modules/visualweb/propertyeditors/css/Bundle"); // NOI18N
0599: positionModeCombo.getAccessibleContext().setAccessibleName(
0600: bundle.getString("POSITION_MODE_ACCESS_NAME")); // NOI18N
0601: positionModeCombo.getAccessibleContext()
0602: .setAccessibleDescription(
0603: bundle.getString("POSITION_MODE_ACCESS_DESC")); // NOI18N
0604:
0605: positionModePanel.add(containerPanel,
0606: java.awt.BorderLayout.WEST);
0607: positionModePanel.add(fillPanel, java.awt.BorderLayout.CENTER);
0608:
0609: positionPanel.add(positionModePanel,
0610: java.awt.BorderLayout.NORTH);
0611:
0612: positionContainerPanel.setBorder(javax.swing.BorderFactory
0613: .createEmptyBorder(0, 5, 5, 5));
0614: positionContainerPanel.setLayout(new java.awt.GridBagLayout());
0615:
0616: posTopLabel.setText(org.openide.util.NbBundle.getMessage(
0617: PositionStyleEditor.class, "POSITION_TOP")); // NOI18N
0618: gridBagConstraints = new java.awt.GridBagConstraints();
0619: gridBagConstraints.gridx = 0;
0620: gridBagConstraints.gridy = 0;
0621: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0622: gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
0623: gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 0);
0624: positionContainerPanel.add(posTopLabel, gridBagConstraints);
0625:
0626: posTopComboBox.setEditable(true);
0627: posTopComboBox
0628: .addActionListener(new java.awt.event.ActionListener() {
0629: public void actionPerformed(
0630: java.awt.event.ActionEvent evt) {
0631: posTopComboBoxActionPerformed(evt);
0632: }
0633: });
0634: posTopComboBox
0635: .addItemListener(new java.awt.event.ItemListener() {
0636: public void itemStateChanged(
0637: java.awt.event.ItemEvent evt) {
0638: posTopComboBoxItemStateChanged(evt);
0639: }
0640: });
0641: gridBagConstraints = new java.awt.GridBagConstraints();
0642: gridBagConstraints.gridx = 1;
0643: gridBagConstraints.gridy = 0;
0644: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0645: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0646: gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 0);
0647: positionContainerPanel.add(posTopComboBox, gridBagConstraints);
0648: posTopComboBox.getAccessibleContext().setAccessibleName(
0649: bundle.getString("POSITION_TOP_ACCESS_NAME")); // NOI18N
0650: posTopComboBox.getAccessibleContext().setAccessibleDescription(
0651: bundle.getString("POSITION_TOP_ACCESS_DESC")); // NOI18N
0652:
0653: posTopUnitComboBox
0654: .addItemListener(new java.awt.event.ItemListener() {
0655: public void itemStateChanged(
0656: java.awt.event.ItemEvent evt) {
0657: posTopUnitComboBoxItemStateChanged(evt);
0658: }
0659: });
0660: gridBagConstraints = new java.awt.GridBagConstraints();
0661: gridBagConstraints.gridx = 2;
0662: gridBagConstraints.gridy = 0;
0663: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0664: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0665: gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 0);
0666: positionContainerPanel.add(posTopUnitComboBox,
0667: gridBagConstraints);
0668: posTopUnitComboBox.getAccessibleContext().setAccessibleName(
0669: bundle.getString("POSITION_TOP_UNIT_ACCESS_NAME")); // NOI18N
0670: posTopUnitComboBox
0671: .getAccessibleContext()
0672: .setAccessibleDescription(
0673: bundle
0674: .getString("POSITION_TOP_UNIT_ACCESS_DESC")); // NOI18N
0675:
0676: posBottomLabel1.setText(org.openide.util.NbBundle.getMessage(
0677: PositionStyleEditor.class, "POSITION_BOTTOM")); // NOI18N
0678: gridBagConstraints = new java.awt.GridBagConstraints();
0679: gridBagConstraints.gridx = 3;
0680: gridBagConstraints.gridy = 0;
0681: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0682: gridBagConstraints.insets = new java.awt.Insets(0, 15, 5, 0);
0683: positionContainerPanel.add(posBottomLabel1, gridBagConstraints);
0684:
0685: posBottomComboBox.setEditable(true);
0686: posBottomComboBox
0687: .addActionListener(new java.awt.event.ActionListener() {
0688: public void actionPerformed(
0689: java.awt.event.ActionEvent evt) {
0690: posBottomComboBoxActionPerformed(evt);
0691: }
0692: });
0693: posBottomComboBox
0694: .addItemListener(new java.awt.event.ItemListener() {
0695: public void itemStateChanged(
0696: java.awt.event.ItemEvent evt) {
0697: posBottomComboBoxItemStateChanged(evt);
0698: }
0699: });
0700: gridBagConstraints = new java.awt.GridBagConstraints();
0701: gridBagConstraints.gridx = 4;
0702: gridBagConstraints.gridy = 0;
0703: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0704: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0705: gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 0);
0706: positionContainerPanel.add(posBottomComboBox,
0707: gridBagConstraints);
0708: posBottomComboBox.getAccessibleContext().setAccessibleName(
0709: bundle.getString("POSITION_BOTTOM_ACCESS_NAME")); // NOI18N
0710: posBottomComboBox
0711: .getAccessibleContext()
0712: .setAccessibleDescription(
0713: bundle.getString("POSITION_BOTTOM_ACCESS_DESC")); // NOI18N
0714:
0715: posBottomUnitComboBox
0716: .addItemListener(new java.awt.event.ItemListener() {
0717: public void itemStateChanged(
0718: java.awt.event.ItemEvent evt) {
0719: posBottomUnitComboBoxItemStateChanged(evt);
0720: }
0721: });
0722: gridBagConstraints = new java.awt.GridBagConstraints();
0723: gridBagConstraints.gridx = 5;
0724: gridBagConstraints.gridy = 0;
0725: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0726: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0727: gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 0);
0728: positionContainerPanel.add(posBottomUnitComboBox,
0729: gridBagConstraints);
0730: posBottomUnitComboBox.getAccessibleContext().setAccessibleName(
0731: bundle.getString("POSITION_BOTTOM_UNIT_ACCESS_NAME")); // NOI18N
0732: posBottomUnitComboBox
0733: .getAccessibleContext()
0734: .setAccessibleDescription(
0735: bundle
0736: .getString("POSITION_BOTTOM_UNIT_ACCESS_DESC")); // NOI18N
0737:
0738: posRightLabel.setText(org.openide.util.NbBundle.getMessage(
0739: PositionStyleEditor.class, "POSITION_RIGHT")); // NOI18N
0740: gridBagConstraints = new java.awt.GridBagConstraints();
0741: gridBagConstraints.gridx = 0;
0742: gridBagConstraints.gridy = 1;
0743: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0744: gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
0745: positionContainerPanel.add(posRightLabel, gridBagConstraints);
0746:
0747: posRightComboBox.setEditable(true);
0748: posRightComboBox
0749: .addActionListener(new java.awt.event.ActionListener() {
0750: public void actionPerformed(
0751: java.awt.event.ActionEvent evt) {
0752: posRightComboBoxActionPerformed(evt);
0753: }
0754: });
0755: posRightComboBox
0756: .addItemListener(new java.awt.event.ItemListener() {
0757: public void itemStateChanged(
0758: java.awt.event.ItemEvent evt) {
0759: posRightComboBoxItemStateChanged(evt);
0760: }
0761: });
0762: gridBagConstraints = new java.awt.GridBagConstraints();
0763: gridBagConstraints.gridx = 1;
0764: gridBagConstraints.gridy = 1;
0765: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0766: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0767: gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
0768: positionContainerPanel
0769: .add(posRightComboBox, gridBagConstraints);
0770: posRightComboBox.getAccessibleContext().setAccessibleName(
0771: bundle.getString("POSITION_RIGHT_ACCESS_NAME")); // NOI18N
0772: posRightComboBox.getAccessibleContext()
0773: .setAccessibleDescription(
0774: bundle.getString("POSITION_Right_ACCESS_DESC")); // NOI18N
0775:
0776: posRightUnitComboBox
0777: .addItemListener(new java.awt.event.ItemListener() {
0778: public void itemStateChanged(
0779: java.awt.event.ItemEvent evt) {
0780: posRightUnitComboBoxItemStateChanged(evt);
0781: }
0782: });
0783: gridBagConstraints = new java.awt.GridBagConstraints();
0784: gridBagConstraints.gridx = 2;
0785: gridBagConstraints.gridy = 1;
0786: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0787: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0788: gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
0789: positionContainerPanel.add(posRightUnitComboBox,
0790: gridBagConstraints);
0791: posRightUnitComboBox.getAccessibleContext().setAccessibleName(
0792: bundle.getString("POSITION_RIGHT_UNIT_ACCESS_NAME")); // NOI18N
0793: posRightUnitComboBox
0794: .getAccessibleContext()
0795: .setAccessibleDescription(
0796: bundle
0797: .getString("POSITION_Right_UNIT_ACCESS_DESC")); // NOI18N
0798:
0799: posLeftLabel1.setText(org.openide.util.NbBundle.getMessage(
0800: PositionStyleEditor.class, "POSITION_LEFT")); // NOI18N
0801: gridBagConstraints = new java.awt.GridBagConstraints();
0802: gridBagConstraints.gridx = 3;
0803: gridBagConstraints.gridy = 1;
0804: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0805: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0806: gridBagConstraints.insets = new java.awt.Insets(0, 15, 0, 0);
0807: positionContainerPanel.add(posLeftLabel1, gridBagConstraints);
0808:
0809: posLeftComboBox.setEditable(true);
0810: posLeftComboBox
0811: .addActionListener(new java.awt.event.ActionListener() {
0812: public void actionPerformed(
0813: java.awt.event.ActionEvent evt) {
0814: posLeftComboBoxActionPerformed(evt);
0815: }
0816: });
0817: posLeftComboBox
0818: .addItemListener(new java.awt.event.ItemListener() {
0819: public void itemStateChanged(
0820: java.awt.event.ItemEvent evt) {
0821: posLeftComboBoxItemStateChanged(evt);
0822: }
0823: });
0824: gridBagConstraints = new java.awt.GridBagConstraints();
0825: gridBagConstraints.gridx = 4;
0826: gridBagConstraints.gridy = 1;
0827: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0828: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0829: gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
0830: positionContainerPanel.add(posLeftComboBox, gridBagConstraints);
0831: posLeftComboBox.getAccessibleContext().setAccessibleName(
0832: bundle.getString("POSITION_LEFT_ACCESS_NAME")); // NOI18N
0833: posLeftComboBox.getAccessibleContext()
0834: .setAccessibleDescription(
0835: bundle.getString("POSITION_LEFT_ACCESS_DESC")); // NOI18N
0836:
0837: posLeftUnitComboBox
0838: .addItemListener(new java.awt.event.ItemListener() {
0839: public void itemStateChanged(
0840: java.awt.event.ItemEvent evt) {
0841: posLeftUnitComboBoxItemStateChanged(evt);
0842: }
0843: });
0844: gridBagConstraints = new java.awt.GridBagConstraints();
0845: gridBagConstraints.gridx = 5;
0846: gridBagConstraints.gridy = 1;
0847: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0848: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0849: gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
0850: positionContainerPanel.add(posLeftUnitComboBox,
0851: gridBagConstraints);
0852: posLeftUnitComboBox.getAccessibleContext().setAccessibleName(
0853: bundle.getString("POSITION_LEFT_UNIT_ACCESS_NAME")); // NOI18N
0854: posLeftUnitComboBox
0855: .getAccessibleContext()
0856: .setAccessibleDescription(
0857: bundle
0858: .getString("POSITION_LEFT_UNIT_ACCESS_DESC")); // NOI18N
0859:
0860: positionPanel.add(positionContainerPanel,
0861: java.awt.BorderLayout.WEST);
0862:
0863: mainPositionPanel.add(positionPanel,
0864: new java.awt.GridBagConstraints());
0865:
0866: sizePanel
0867: .setBorder(javax.swing.BorderFactory
0868: .createTitledBorder(
0869: javax.swing.BorderFactory
0870: .createEmptyBorder(1, 1, 1, 1),
0871: org.openide.util.NbBundle.getMessage(
0872: PositionStyleEditor.class,
0873: "SIZE_LABEL"),
0874: javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
0875: javax.swing.border.TitledBorder.ABOVE_TOP)); // NOI18N
0876: sizePanel.setLayout(new java.awt.BorderLayout());
0877:
0878: sizeContainerPanel.setBorder(javax.swing.BorderFactory
0879: .createEmptyBorder(5, 5, 5, 5));
0880: sizeContainerPanel.setLayout(new java.awt.GridBagLayout());
0881:
0882: heightLabel.setText(org.openide.util.NbBundle.getMessage(
0883: PositionStyleEditor.class, "POSITION_HEIGHT")); // NOI18N
0884: gridBagConstraints = new java.awt.GridBagConstraints();
0885: gridBagConstraints.gridx = 0;
0886: gridBagConstraints.gridy = 1;
0887: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0888: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0889: sizeContainerPanel.add(heightLabel, gridBagConstraints);
0890:
0891: heightComboBox.setEditable(true);
0892: heightComboBox
0893: .addActionListener(new java.awt.event.ActionListener() {
0894: public void actionPerformed(
0895: java.awt.event.ActionEvent evt) {
0896: heightComboBoxActionPerformed(evt);
0897: }
0898: });
0899: heightComboBox
0900: .addItemListener(new java.awt.event.ItemListener() {
0901: public void itemStateChanged(
0902: java.awt.event.ItemEvent evt) {
0903: heightComboBoxItemStateChanged(evt);
0904: }
0905: });
0906: gridBagConstraints = new java.awt.GridBagConstraints();
0907: gridBagConstraints.gridx = 1;
0908: gridBagConstraints.gridy = 1;
0909: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0910: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0911: gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
0912: sizeContainerPanel.add(heightComboBox, gridBagConstraints);
0913: heightComboBox.getAccessibleContext().setAccessibleName(
0914: bundle.getString("HEIGHT_ACCESS_NAME")); // NOI18N
0915: heightComboBox.getAccessibleContext().setAccessibleDescription(
0916: bundle.getString("HEIGHT_ACCESS_DESC")); // NOI18N
0917:
0918: heightUnitComboBox
0919: .addItemListener(new java.awt.event.ItemListener() {
0920: public void itemStateChanged(
0921: java.awt.event.ItemEvent evt) {
0922: heightUnitComboBoxItemStateChanged(evt);
0923: }
0924: });
0925: gridBagConstraints = new java.awt.GridBagConstraints();
0926: gridBagConstraints.gridx = 2;
0927: gridBagConstraints.gridy = 1;
0928: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0929: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0930: gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
0931: sizeContainerPanel.add(heightUnitComboBox, gridBagConstraints);
0932: heightUnitComboBox.getAccessibleContext().setAccessibleName(
0933: bundle.getString("HEIGHT_UNIT_ACCESS_NAME")); // NOI18N
0934: heightUnitComboBox.getAccessibleContext()
0935: .setAccessibleDescription(
0936: bundle.getString("HEIGHT_UNIT_ACCESS_DESC")); // NOI18N
0937:
0938: widthLabel.setText(org.openide.util.NbBundle.getMessage(
0939: PositionStyleEditor.class, "POSITION_WIDTH")); // NOI18N
0940: gridBagConstraints = new java.awt.GridBagConstraints();
0941: gridBagConstraints.gridx = 0;
0942: gridBagConstraints.gridy = 0;
0943: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0944: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0945: gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 0);
0946: sizeContainerPanel.add(widthLabel, gridBagConstraints);
0947:
0948: widthComboBox.setEditable(true);
0949: widthComboBox
0950: .addActionListener(new java.awt.event.ActionListener() {
0951: public void actionPerformed(
0952: java.awt.event.ActionEvent evt) {
0953: widthComboBoxActionPerformed(evt);
0954: }
0955: });
0956: widthComboBox
0957: .addItemListener(new java.awt.event.ItemListener() {
0958: public void itemStateChanged(
0959: java.awt.event.ItemEvent evt) {
0960: widthComboBoxItemStateChanged(evt);
0961: }
0962: });
0963: gridBagConstraints = new java.awt.GridBagConstraints();
0964: gridBagConstraints.gridx = 1;
0965: gridBagConstraints.gridy = 0;
0966: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0967: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0968: gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 0);
0969: sizeContainerPanel.add(widthComboBox, gridBagConstraints);
0970: widthComboBox.getAccessibleContext().setAccessibleName(
0971: bundle.getString("WIDTH_ACCESS_NAME")); // NOI18N
0972: widthComboBox.getAccessibleContext().setAccessibleDescription(
0973: bundle.getString("WIDTH_ACCESS_DESC")); // NOI18N
0974:
0975: widthUnitComboBox
0976: .addItemListener(new java.awt.event.ItemListener() {
0977: public void itemStateChanged(
0978: java.awt.event.ItemEvent evt) {
0979: widthUnitComboBoxItemStateChanged(evt);
0980: }
0981: });
0982: gridBagConstraints = new java.awt.GridBagConstraints();
0983: gridBagConstraints.gridx = 2;
0984: gridBagConstraints.gridy = 0;
0985: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0986: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0987: gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 0);
0988: sizeContainerPanel.add(widthUnitComboBox, gridBagConstraints);
0989: widthUnitComboBox.getAccessibleContext().setAccessibleName(
0990: bundle.getString("WIDTH_UNIT_ACCESS_NAME")); // NOI18N
0991: widthUnitComboBox.getAccessibleContext()
0992: .setAccessibleDescription(
0993: bundle.getString("WIDTH_UNIT_ACCESS_DESC")); // NOI18N
0994:
0995: visibleLabel1.setText(org.openide.util.NbBundle.getMessage(
0996: PositionStyleEditor.class, "VISIBILITY")); // NOI18N
0997: gridBagConstraints = new java.awt.GridBagConstraints();
0998: gridBagConstraints.gridx = 3;
0999: gridBagConstraints.gridy = 0;
1000: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1001: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1002: gridBagConstraints.insets = new java.awt.Insets(0, 15, 5, 0);
1003: sizeContainerPanel.add(visibleLabel1, gridBagConstraints);
1004:
1005: visibleComboBox
1006: .addFocusListener(new java.awt.event.FocusAdapter() {
1007: public void focusGained(
1008: java.awt.event.FocusEvent evt) {
1009: visibleComboBoxFocusGained(evt);
1010: }
1011:
1012: public void focusLost(java.awt.event.FocusEvent evt) {
1013: visibleComboBoxFocusLost(evt);
1014: }
1015: });
1016: visibleComboBox
1017: .addItemListener(new java.awt.event.ItemListener() {
1018: public void itemStateChanged(
1019: java.awt.event.ItemEvent evt) {
1020: visibleComboBoxItemStateChanged(evt);
1021: }
1022: });
1023: gridBagConstraints = new java.awt.GridBagConstraints();
1024: gridBagConstraints.gridx = 4;
1025: gridBagConstraints.gridy = 0;
1026: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1027: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1028: gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 0);
1029: sizeContainerPanel.add(visibleComboBox, gridBagConstraints);
1030: visibleComboBox.getAccessibleContext().setAccessibleName(
1031: bundle.getString("VISIBILITY_ACCESS_NAME")); // NOI18N
1032: visibleComboBox.getAccessibleContext()
1033: .setAccessibleDescription(
1034: bundle.getString("VISIBILITY_ACCESS_DESC")); // NOI18N
1035:
1036: zIndexLabel1.setText(org.openide.util.NbBundle.getMessage(
1037: PositionStyleEditor.class, "Z_INDEX")); // NOI18N
1038: gridBagConstraints = new java.awt.GridBagConstraints();
1039: gridBagConstraints.gridx = 3;
1040: gridBagConstraints.gridy = 1;
1041: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1042: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1043: gridBagConstraints.insets = new java.awt.Insets(0, 15, 0, 0);
1044: sizeContainerPanel.add(zIndexLabel1, gridBagConstraints);
1045:
1046: zindexComboBox.setEditable(true);
1047: zindexComboBox
1048: .addItemListener(new java.awt.event.ItemListener() {
1049: public void itemStateChanged(
1050: java.awt.event.ItemEvent evt) {
1051: zindexComboBoxItemStateChanged(evt);
1052: }
1053: });
1054: gridBagConstraints = new java.awt.GridBagConstraints();
1055: gridBagConstraints.gridx = 4;
1056: gridBagConstraints.gridy = 1;
1057: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1058: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1059: gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
1060: sizeContainerPanel.add(zindexComboBox, gridBagConstraints);
1061: zindexComboBox.getAccessibleContext().setAccessibleName(
1062: bundle.getString("ZINDEX_ACCESS_NAME")); // NOI18N
1063: zindexComboBox.getAccessibleContext().setAccessibleDescription(
1064: bundle.getString("ZINDEX_ACCESS_DESC")); // NOI18N
1065:
1066: sizePanel.add(sizeContainerPanel, java.awt.BorderLayout.WEST);
1067:
1068: gridBagConstraints = new java.awt.GridBagConstraints();
1069: gridBagConstraints.gridx = 0;
1070: gridBagConstraints.gridy = 1;
1071: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1072: gridBagConstraints.insets = new java.awt.Insets(15, 0, 0, 0);
1073: mainPositionPanel.add(sizePanel, gridBagConstraints);
1074:
1075: clipPanel
1076: .setBorder(javax.swing.BorderFactory
1077: .createTitledBorder(
1078: javax.swing.BorderFactory
1079: .createEmptyBorder(1, 1, 1, 1),
1080: org.openide.util.NbBundle.getMessage(
1081: PositionStyleEditor.class,
1082: "CLIP_LABEL"),
1083: javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
1084: javax.swing.border.TitledBorder.ABOVE_TOP)); // NOI18N
1085: clipPanel.setLayout(new java.awt.BorderLayout());
1086:
1087: clipContainerPanel.setBorder(javax.swing.BorderFactory
1088: .createEmptyBorder(5, 5, 5, 5));
1089: clipContainerPanel.setLayout(new java.awt.GridBagLayout());
1090:
1091: clipLeftLabel1.setText(org.openide.util.NbBundle.getMessage(
1092: PositionStyleEditor.class, "CLIP_LEFT")); // NOI18N
1093: gridBagConstraints = new java.awt.GridBagConstraints();
1094: gridBagConstraints.gridx = 3;
1095: gridBagConstraints.gridy = 1;
1096: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1097: gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
1098: gridBagConstraints.insets = new java.awt.Insets(0, 15, 0, 0);
1099: clipContainerPanel.add(clipLeftLabel1, gridBagConstraints);
1100:
1101: clipBottomUnitComboBox
1102: .addItemListener(new java.awt.event.ItemListener() {
1103: public void itemStateChanged(
1104: java.awt.event.ItemEvent evt) {
1105: clipBottomUnitComboBoxItemStateChanged(evt);
1106: }
1107: });
1108: gridBagConstraints = new java.awt.GridBagConstraints();
1109: gridBagConstraints.gridx = 5;
1110: gridBagConstraints.gridy = 0;
1111: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1112: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1113: gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 0);
1114: clipContainerPanel.add(clipBottomUnitComboBox,
1115: gridBagConstraints);
1116: clipBottomUnitComboBox
1117: .getAccessibleContext()
1118: .setAccessibleName(
1119: bundle
1120: .getString("CLIP_BOTTOM_UNIT_ACCESS_NAME")); // NOI18N
1121: clipBottomUnitComboBox
1122: .getAccessibleContext()
1123: .setAccessibleDescription(
1124: bundle
1125: .getString("CLIP_BOTTOM_UNIT_ACCESS_DESC")); // NOI18N
1126:
1127: clipLeftUnitComboBox
1128: .addItemListener(new java.awt.event.ItemListener() {
1129: public void itemStateChanged(
1130: java.awt.event.ItemEvent evt) {
1131: clipLeftUnitComboBoxItemStateChanged(evt);
1132: }
1133: });
1134: gridBagConstraints = new java.awt.GridBagConstraints();
1135: gridBagConstraints.gridx = 5;
1136: gridBagConstraints.gridy = 1;
1137: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1138: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1139: gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
1140: clipContainerPanel
1141: .add(clipLeftUnitComboBox, gridBagConstraints);
1142: clipLeftUnitComboBox.getAccessibleContext().setAccessibleName(
1143: bundle.getString("CLIP_LEFT_UNIT_ACCESS_NAME")); // NOI18N
1144: clipLeftUnitComboBox.getAccessibleContext()
1145: .setAccessibleDescription(
1146: bundle.getString("CLIP_LEFT_UNIT_ACCESS_DESC")); // NOI18N
1147:
1148: clipTopLabel1.setText(org.openide.util.NbBundle.getMessage(
1149: PositionStyleEditor.class, "CLIP_TOP")); // NOI18N
1150: gridBagConstraints = new java.awt.GridBagConstraints();
1151: gridBagConstraints.gridx = 0;
1152: gridBagConstraints.gridy = 0;
1153: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1154: gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
1155: gridBagConstraints.insets = new java.awt.Insets(0, 0, 5, 0);
1156: clipContainerPanel.add(clipTopLabel1, gridBagConstraints);
1157:
1158: clipLeftComboBox.setEditable(true);
1159: clipLeftComboBox
1160: .addActionListener(new java.awt.event.ActionListener() {
1161: public void actionPerformed(
1162: java.awt.event.ActionEvent evt) {
1163: clipLeftComboBoxActionPerformed(evt);
1164: }
1165: });
1166: clipLeftComboBox
1167: .addItemListener(new java.awt.event.ItemListener() {
1168: public void itemStateChanged(
1169: java.awt.event.ItemEvent evt) {
1170: clipLeftComboBoxItemStateChanged(evt);
1171: }
1172: });
1173: gridBagConstraints = new java.awt.GridBagConstraints();
1174: gridBagConstraints.gridx = 4;
1175: gridBagConstraints.gridy = 1;
1176: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1177: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1178: gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
1179: clipContainerPanel.add(clipLeftComboBox, gridBagConstraints);
1180: clipLeftComboBox.getAccessibleContext().setAccessibleName(
1181: bundle.getString("CLIP_LEFT_ACCESS_NAME")); // NOI18N
1182: clipLeftComboBox.getAccessibleContext()
1183: .setAccessibleDescription(
1184: bundle.getString("CLIP_LEFT_ACCESS_DESC")); // NOI18N
1185:
1186: clipTopUnitComboBox
1187: .addItemListener(new java.awt.event.ItemListener() {
1188: public void itemStateChanged(
1189: java.awt.event.ItemEvent evt) {
1190: clipTopUnitComboBoxItemStateChanged(evt);
1191: }
1192: });
1193: gridBagConstraints = new java.awt.GridBagConstraints();
1194: gridBagConstraints.gridx = 2;
1195: gridBagConstraints.gridy = 0;
1196: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1197: gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 0);
1198: clipContainerPanel.add(clipTopUnitComboBox, gridBagConstraints);
1199: clipTopUnitComboBox.getAccessibleContext().setAccessibleName(
1200: bundle.getString("CLIP_TOP_UNIT_ACCESS_NAME")); // NOI18N
1201: clipTopUnitComboBox.getAccessibleContext()
1202: .setAccessibleDescription(
1203: bundle.getString("CLIP_TOP_UNIT_ACCESS_DESC")); // NOI18N
1204:
1205: clipRightLabel1.setText(org.openide.util.NbBundle.getMessage(
1206: PositionStyleEditor.class, "CLIP_RIGHT")); // NOI18N
1207: gridBagConstraints = new java.awt.GridBagConstraints();
1208: gridBagConstraints.gridx = 0;
1209: gridBagConstraints.gridy = 1;
1210: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1211: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1212: clipContainerPanel.add(clipRightLabel1, gridBagConstraints);
1213:
1214: clipBottomComboBox.setEditable(true);
1215: clipBottomComboBox
1216: .addActionListener(new java.awt.event.ActionListener() {
1217: public void actionPerformed(
1218: java.awt.event.ActionEvent evt) {
1219: clipBottomComboBoxActionPerformed(evt);
1220: }
1221: });
1222: clipBottomComboBox
1223: .addItemListener(new java.awt.event.ItemListener() {
1224: public void itemStateChanged(
1225: java.awt.event.ItemEvent evt) {
1226: clipBottomComboBoxItemStateChanged(evt);
1227: }
1228: });
1229: gridBagConstraints = new java.awt.GridBagConstraints();
1230: gridBagConstraints.gridx = 4;
1231: gridBagConstraints.gridy = 0;
1232: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1233: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1234: gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 0);
1235: clipContainerPanel.add(clipBottomComboBox, gridBagConstraints);
1236: clipBottomComboBox.getAccessibleContext().setAccessibleName(
1237: bundle.getString("CLIP_BOTTOM_ACCESS_NAME")); // NOI18N
1238: clipBottomComboBox.getAccessibleContext()
1239: .setAccessibleDescription(
1240: bundle.getString("CLIP_BOTTOM_ACCESS_DESC")); // NOI18N
1241:
1242: clipRightUnitComboBox
1243: .addItemListener(new java.awt.event.ItemListener() {
1244: public void itemStateChanged(
1245: java.awt.event.ItemEvent evt) {
1246: clipRightUnitComboBoxItemStateChanged(evt);
1247: }
1248: });
1249: gridBagConstraints = new java.awt.GridBagConstraints();
1250: gridBagConstraints.gridx = 2;
1251: gridBagConstraints.gridy = 1;
1252: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1253: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1254: gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
1255: clipContainerPanel.add(clipRightUnitComboBox,
1256: gridBagConstraints);
1257: clipRightUnitComboBox.getAccessibleContext().setAccessibleName(
1258: bundle.getString("CLIP_RIGHT_UNIT_ACCESS_NAME")); // NOI18N
1259: clipRightUnitComboBox
1260: .getAccessibleContext()
1261: .setAccessibleDescription(
1262: bundle.getString("CLIP_RIGHT_UNIT_ACCESS_DESC")); // NOI18N
1263:
1264: clipBottomLabel.setText(org.openide.util.NbBundle.getMessage(
1265: PositionStyleEditor.class, "CLIP_BOTTOM")); // NOI18N
1266: gridBagConstraints = new java.awt.GridBagConstraints();
1267: gridBagConstraints.gridx = 3;
1268: gridBagConstraints.gridy = 0;
1269: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1270: gridBagConstraints.insets = new java.awt.Insets(0, 15, 5, 0);
1271: clipContainerPanel.add(clipBottomLabel, gridBagConstraints);
1272:
1273: clipTopComboBox.setEditable(true);
1274: clipTopComboBox
1275: .addActionListener(new java.awt.event.ActionListener() {
1276: public void actionPerformed(
1277: java.awt.event.ActionEvent evt) {
1278: clipTopComboBoxActionPerformed(evt);
1279: }
1280: });
1281: clipTopComboBox
1282: .addItemListener(new java.awt.event.ItemListener() {
1283: public void itemStateChanged(
1284: java.awt.event.ItemEvent evt) {
1285: clipTopComboBoxItemStateChanged(evt);
1286: }
1287: });
1288: gridBagConstraints = new java.awt.GridBagConstraints();
1289: gridBagConstraints.gridx = 1;
1290: gridBagConstraints.gridy = 0;
1291: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1292: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1293: gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 0);
1294: clipContainerPanel.add(clipTopComboBox, gridBagConstraints);
1295: clipTopComboBox.getAccessibleContext().setAccessibleName(
1296: bundle.getString("CLIP_TOP_ACCESS_NAME")); // NOI18N
1297: clipTopComboBox.getAccessibleContext()
1298: .setAccessibleDescription(
1299: bundle.getString("CLIP_TOP_ACCESS_DESC")); // NOI18N
1300:
1301: clipRightComboBox.setEditable(true);
1302: clipRightComboBox
1303: .addActionListener(new java.awt.event.ActionListener() {
1304: public void actionPerformed(
1305: java.awt.event.ActionEvent evt) {
1306: clipRightComboBoxActionPerformed(evt);
1307: }
1308: });
1309: clipRightComboBox
1310: .addItemListener(new java.awt.event.ItemListener() {
1311: public void itemStateChanged(
1312: java.awt.event.ItemEvent evt) {
1313: clipRightComboBoxItemStateChanged(evt);
1314: }
1315: });
1316: gridBagConstraints = new java.awt.GridBagConstraints();
1317: gridBagConstraints.gridx = 1;
1318: gridBagConstraints.gridy = 1;
1319: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1320: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1321: gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
1322: clipContainerPanel.add(clipRightComboBox, gridBagConstraints);
1323: clipRightComboBox.getAccessibleContext().setAccessibleName(
1324: bundle.getString("CLIP_RIGHT_ACCESS_NAME")); // NOI18N
1325: clipRightComboBox.getAccessibleContext()
1326: .setAccessibleDescription(
1327: bundle.getString("CLIP_RIGHT_ACCESS_DESC")); // NOI18N
1328:
1329: clipPanel.add(clipContainerPanel, java.awt.BorderLayout.WEST);
1330:
1331: clipErrorPanel.setBorder(javax.swing.BorderFactory
1332: .createEmptyBorder(1, 10, 1, 1));
1333: clipErrorPanel.setLayout(new java.awt.BorderLayout());
1334:
1335: clipErrorLabel.setForeground(new java.awt.Color(0, 0, 153));
1336: clipErrorLabel.setMinimumSize(new java.awt.Dimension(200, 20));
1337: clipErrorLabel
1338: .setPreferredSize(new java.awt.Dimension(200, 20));
1339: clipErrorPanel
1340: .add(clipErrorLabel, java.awt.BorderLayout.CENTER);
1341:
1342: clipPanel.add(clipErrorPanel, java.awt.BorderLayout.SOUTH);
1343:
1344: gridBagConstraints = new java.awt.GridBagConstraints();
1345: gridBagConstraints.gridx = 0;
1346: gridBagConstraints.gridy = 2;
1347: gridBagConstraints.insets = new java.awt.Insets(15, 0, 0, 0);
1348: mainPositionPanel.add(clipPanel, gridBagConstraints);
1349:
1350: errorPanel.setBorder(javax.swing.BorderFactory
1351: .createEmptyBorder(1, 10, 1, 1));
1352: errorPanel.setLayout(new java.awt.BorderLayout());
1353:
1354: errorLabel.setForeground(new java.awt.Color(0, 0, 153));
1355: errorLabel.setMinimumSize(new java.awt.Dimension(200, 20));
1356: errorLabel.setPreferredSize(new java.awt.Dimension(200, 20));
1357: errorPanel.add(errorLabel, java.awt.BorderLayout.CENTER);
1358:
1359: gridBagConstraints = new java.awt.GridBagConstraints();
1360: gridBagConstraints.gridx = 0;
1361: gridBagConstraints.gridy = 3;
1362: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1363: gridBagConstraints.insets = new java.awt.Insets(10, 0, 0, 0);
1364: mainPositionPanel.add(errorPanel, gridBagConstraints);
1365:
1366: add(mainPositionPanel, java.awt.BorderLayout.NORTH);
1367: }// </editor-fold>//GEN-END:initComponents
1368:
1369: private void visibleComboBoxFocusGained(
1370: java.awt.event.FocusEvent evt) {//GEN-FIRST:event_visibleComboBoxFocusGained
1371: errorLabel.setText(CssStyleData.PREVIEW_NOT_SUPPORTED);
1372: }//GEN-LAST:event_visibleComboBoxFocusGained
1373:
1374: private void visibleComboBoxFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_visibleComboBoxFocusLost
1375: errorLabel.setText("");
1376: }//GEN-LAST:event_visibleComboBoxFocusLost
1377:
1378: private void clipLeftUnitComboBoxItemStateChanged(
1379: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_clipLeftUnitComboBoxItemStateChanged
1380: if (evt.getStateChange() != evt.DESELECTED) {
1381: setClip();
1382: }
1383: }//GEN-LAST:event_clipLeftUnitComboBoxItemStateChanged
1384:
1385: private void clipLeftComboBoxItemStateChanged(
1386: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_clipLeftComboBoxItemStateChanged
1387: if (evt.getStateChange() != evt.DESELECTED) {
1388: setClip();
1389: }
1390: }//GEN-LAST:event_clipLeftComboBoxItemStateChanged
1391:
1392: private void clipLeftComboBoxActionPerformed(
1393: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clipLeftComboBoxActionPerformed
1394: setClip();
1395: }//GEN-LAST:event_clipLeftComboBoxActionPerformed
1396:
1397: private void clipBottomUnitComboBoxItemStateChanged(
1398: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_clipBottomUnitComboBoxItemStateChanged
1399: if (evt.getStateChange() != evt.DESELECTED) {
1400: setClip();
1401: }
1402: }//GEN-LAST:event_clipBottomUnitComboBoxItemStateChanged
1403:
1404: private void clipBottomComboBoxItemStateChanged(
1405: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_clipBottomComboBoxItemStateChanged
1406: if (evt.getStateChange() != evt.DESELECTED) {
1407: setClip();
1408: }
1409: }//GEN-LAST:event_clipBottomComboBoxItemStateChanged
1410:
1411: private void clipBottomComboBoxActionPerformed(
1412: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clipBottomComboBoxActionPerformed
1413: setClip();
1414: }//GEN-LAST:event_clipBottomComboBoxActionPerformed
1415:
1416: private void clipRightUnitComboBoxItemStateChanged(
1417: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_clipRightUnitComboBoxItemStateChanged
1418: if (evt.getStateChange() != evt.DESELECTED) {
1419: setClip();
1420: }
1421: }//GEN-LAST:event_clipRightUnitComboBoxItemStateChanged
1422:
1423: private void clipRightComboBoxItemStateChanged(
1424: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_clipRightComboBoxItemStateChanged
1425: if (evt.getStateChange() != evt.DESELECTED) {
1426: setClip();
1427: }
1428: }//GEN-LAST:event_clipRightComboBoxItemStateChanged
1429:
1430: private void clipRightComboBoxActionPerformed(
1431: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clipRightComboBoxActionPerformed
1432: setClip();
1433: }//GEN-LAST:event_clipRightComboBoxActionPerformed
1434:
1435: private void clipTopUnitComboBoxItemStateChanged(
1436: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_clipTopUnitComboBoxItemStateChanged
1437: if (evt.getStateChange() != evt.DESELECTED) {
1438: setClip();
1439: }
1440: }//GEN-LAST:event_clipTopUnitComboBoxItemStateChanged
1441:
1442: private void clipTopComboBoxItemStateChanged(
1443: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_clipTopComboBoxItemStateChanged
1444: if (evt.getStateChange() != evt.DESELECTED) {
1445: setClip();
1446: }
1447: }//GEN-LAST:event_clipTopComboBoxItemStateChanged
1448:
1449: private void clipTopComboBoxActionPerformed(
1450: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clipTopComboBoxActionPerformed
1451: setClip();
1452: }//GEN-LAST:event_clipTopComboBoxActionPerformed
1453:
1454: private void zindexComboBoxItemStateChanged(
1455: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_zindexComboBoxItemStateChanged
1456: setZindex();
1457: }//GEN-LAST:event_zindexComboBoxItemStateChanged
1458:
1459: private void visibleComboBoxItemStateChanged(
1460: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_visibleComboBoxItemStateChanged
1461: setVisibility();
1462: }//GEN-LAST:event_visibleComboBoxItemStateChanged
1463:
1464: private void heightUnitComboBoxItemStateChanged(
1465: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_heightUnitComboBoxItemStateChanged
1466: if (evt.getStateChange() != evt.DESELECTED) {
1467: setHeight();
1468: }
1469: }//GEN-LAST:event_heightUnitComboBoxItemStateChanged
1470:
1471: private void heightComboBoxItemStateChanged(
1472: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_heightComboBoxItemStateChanged
1473: if (evt.getStateChange() != evt.DESELECTED) {
1474: setHeight();
1475: }
1476: }//GEN-LAST:event_heightComboBoxItemStateChanged
1477:
1478: private void heightComboBoxActionPerformed(
1479: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_heightComboBoxActionPerformed
1480: setHeight();
1481: }//GEN-LAST:event_heightComboBoxActionPerformed
1482:
1483: private void widthComboBoxActionPerformed(
1484: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_widthComboBoxActionPerformed
1485: setWidth();
1486: }//GEN-LAST:event_widthComboBoxActionPerformed
1487:
1488: private void widthComboBoxItemStateChanged(
1489: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_widthComboBoxItemStateChanged
1490: if (evt.getStateChange() != evt.DESELECTED) {
1491: setWidth();
1492: }
1493: }//GEN-LAST:event_widthComboBoxItemStateChanged
1494:
1495: private void widthUnitComboBoxItemStateChanged(
1496: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_widthUnitComboBoxItemStateChanged
1497: if (evt.getStateChange() != evt.DESELECTED) {
1498: setWidth();
1499: }
1500: }//GEN-LAST:event_widthUnitComboBoxItemStateChanged
1501:
1502: private void posRightUnitComboBoxItemStateChanged(
1503: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_posRightUnitComboBoxItemStateChanged
1504: if (evt.getStateChange() != evt.DESELECTED) {
1505: setRightPos();
1506: }
1507: }//GEN-LAST:event_posRightUnitComboBoxItemStateChanged
1508:
1509: private void posRightComboBoxItemStateChanged(
1510: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_posRightComboBoxItemStateChanged
1511: if (evt.getStateChange() != evt.DESELECTED) {
1512: setRightPos();
1513: }
1514: }//GEN-LAST:event_posRightComboBoxItemStateChanged
1515:
1516: private void posRightComboBoxActionPerformed(
1517: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_posRightComboBoxActionPerformed
1518: setRightPos();
1519: }//GEN-LAST:event_posRightComboBoxActionPerformed
1520:
1521: private void posLeftUnitComboBoxItemStateChanged(
1522: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_posLeftUnitComboBoxItemStateChanged
1523: if (evt.getStateChange() != evt.DESELECTED) {
1524: setLeftPos();
1525: }
1526: }//GEN-LAST:event_posLeftUnitComboBoxItemStateChanged
1527:
1528: private void posLeftComboBoxItemStateChanged(
1529: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_posLeftComboBoxItemStateChanged
1530: if (evt.getStateChange() != evt.DESELECTED) {
1531: setLeftPos();
1532: }
1533: }//GEN-LAST:event_posLeftComboBoxItemStateChanged
1534:
1535: private void posLeftComboBoxActionPerformed(
1536: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_posLeftComboBoxActionPerformed
1537: setLeftPos();
1538: }//GEN-LAST:event_posLeftComboBoxActionPerformed
1539:
1540: private void posBottomUnitComboBoxItemStateChanged(
1541: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_posBottomUnitComboBoxItemStateChanged
1542: if (evt.getStateChange() != evt.DESELECTED) {
1543: setBottomPos();
1544: }
1545: }//GEN-LAST:event_posBottomUnitComboBoxItemStateChanged
1546:
1547: private void posBottomComboBoxItemStateChanged(
1548: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_posBottomComboBoxItemStateChanged
1549: if (evt.getStateChange() != evt.DESELECTED) {
1550: setBottomPos();
1551: }
1552: }//GEN-LAST:event_posBottomComboBoxItemStateChanged
1553:
1554: private void posBottomComboBoxActionPerformed(
1555: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_posBottomComboBoxActionPerformed
1556: setBottomPos();
1557: }//GEN-LAST:event_posBottomComboBoxActionPerformed
1558:
1559: private void posTopUnitComboBoxItemStateChanged(
1560: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_posTopUnitComboBoxItemStateChanged
1561: if (evt.getStateChange() != evt.DESELECTED) {
1562: setTopPos();
1563: }
1564: }//GEN-LAST:event_posTopUnitComboBoxItemStateChanged
1565:
1566: private void posTopComboBoxItemStateChanged(
1567: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_posTopComboBoxItemStateChanged
1568: if (evt.getStateChange() != evt.DESELECTED) {
1569: setTopPos();
1570: }
1571: }//GEN-LAST:event_posTopComboBoxItemStateChanged
1572:
1573: private void posTopComboBoxActionPerformed(
1574: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_posTopComboBoxActionPerformed
1575: setTopPos();
1576: }//GEN-LAST:event_posTopComboBoxActionPerformed
1577:
1578: private void positionModeComboItemStateChanged(
1579: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_positionModeComboItemStateChanged
1580: setPosition();
1581: }//GEN-LAST:event_positionModeComboItemStateChanged
1582:
1583: private void setClip() {
1584: ClipData clipData = new ClipData();
1585: clipData.setTop(clipTopComboBox.getSelectedItem().toString());
1586: clipData.setTopUnit(clipTopUnitComboBox.getSelectedItem()
1587: .toString());
1588: clipTopUnitComboBox.setEnabled(clipData.isTopValueInteger());
1589: clipData.setRight(clipRightComboBox.getSelectedItem()
1590: .toString());
1591: clipData.setRightUnit(clipRightUnitComboBox.getSelectedItem()
1592: .toString());
1593: clipRightUnitComboBox
1594: .setEnabled(clipData.isRightValueInteger());
1595: clipData.setBottom(clipBottomComboBox.getSelectedItem()
1596: .toString());
1597: clipData.setBottomUnit(clipBottomUnitComboBox.getSelectedItem()
1598: .toString());
1599: clipBottomUnitComboBox.setEnabled(clipData
1600: .isBottomValueInteger());
1601: clipData.setLeft(clipLeftComboBox.getSelectedItem().toString());
1602: clipData.setLeftUnit(clipLeftUnitComboBox.getSelectedItem()
1603: .toString());
1604: clipLeftUnitComboBox.setEnabled(clipData.isLeftValueInteger());
1605: cssStyleData.modifyProperty(CssStyleData.CLIP, clipData
1606: .toString());
1607: if (clipData.hasErros()) {
1608: clipErrorLabel.setText(org.openide.util.NbBundle
1609: .getMessage(PositionStyleEditor.class,
1610: "CLIP_MESSAGE"));
1611: } else {
1612: clipErrorLabel.setText("");
1613: }
1614: }
1615:
1616: private void setZindex() {
1617: PropertyData zindexData = new PropertyData();
1618: zindexData
1619: .setValue(zindexComboBox.getSelectedItem().toString());
1620: cssStyleData.modifyProperty(CssStyleData.Z_INDEX, zindexData
1621: .toString());
1622: }
1623:
1624: public void setVisibility() {
1625: PropertyData visibleData = new PropertyData();
1626: visibleData.setValue(visibleComboBox.getSelectedItem()
1627: .toString());
1628: cssStyleData.modifyProperty(CssStyleData.VISIBILITY,
1629: visibleData.toString());
1630: }
1631:
1632: private void setHeight() {
1633: PropertyWithUnitData heightData = new PropertyWithUnitData();
1634: heightData.setUnit(heightUnitComboBox.getSelectedItem()
1635: .toString());
1636: heightData
1637: .setValue(heightComboBox.getSelectedItem().toString());
1638: cssStyleData.modifyProperty(CssStyleData.HEIGHT, heightData
1639: .toString());
1640: heightUnitComboBox.setEnabled(heightData.isValueInteger());
1641: }
1642:
1643: private void setWidth() {
1644: PropertyWithUnitData widthData = new PropertyWithUnitData();
1645: widthData.setUnit(widthUnitComboBox.getSelectedItem()
1646: .toString());
1647: widthData.setValue(widthComboBox.getSelectedItem().toString());
1648: cssStyleData.modifyProperty(CssStyleData.WIDTH, widthData
1649: .toString());
1650: widthUnitComboBox.setEnabled(widthData.isValueInteger());
1651: }
1652:
1653: private void setRightPos() {
1654: PropertyWithUnitData posRightData = new PropertyWithUnitData();
1655: posRightData.setUnit(posRightUnitComboBox.getSelectedItem()
1656: .toString());
1657: posRightData.setValue(posRightComboBox.getSelectedItem()
1658: .toString());
1659: cssStyleData.modifyProperty(CssStyleData.RIGHT, posRightData
1660: .toString());
1661: posRightUnitComboBox.setEnabled(posRightData.isValueInteger());
1662: }
1663:
1664: private void setLeftPos() {
1665: PropertyWithUnitData posLeftData = new PropertyWithUnitData();
1666: posLeftData.setUnit(posLeftUnitComboBox.getSelectedItem()
1667: .toString());
1668: posLeftData.setValue(posLeftComboBox.getSelectedItem()
1669: .toString());
1670: cssStyleData.modifyProperty(CssStyleData.LEFT, posLeftData
1671: .toString());
1672: posLeftUnitComboBox.setEnabled(posLeftData.isValueInteger());
1673: }
1674:
1675: private void setBottomPos() {
1676: PropertyWithUnitData posBottomData = new PropertyWithUnitData();
1677: posBottomData.setUnit(posBottomUnitComboBox.getSelectedItem()
1678: .toString());
1679: posBottomData.setValue(posBottomComboBox.getSelectedItem()
1680: .toString());
1681: cssStyleData.modifyProperty(CssStyleData.BOTTOM, posBottomData
1682: .toString());
1683: posBottomUnitComboBox
1684: .setEnabled(posBottomData.isValueInteger());
1685: }
1686:
1687: private void setTopPos() {
1688: PropertyWithUnitData posTopData = new PropertyWithUnitData();
1689: posTopData.setUnit(posTopUnitComboBox.getSelectedItem()
1690: .toString());
1691: posTopData
1692: .setValue(posTopComboBox.getSelectedItem().toString());
1693: cssStyleData.modifyProperty(CssStyleData.TOP, posTopData
1694: .toString());
1695: posTopUnitComboBox.setEnabled(posTopData.isValueInteger());
1696: }
1697:
1698: public void setPosition() {
1699: PropertyData positionData = new PropertyData();
1700: positionData.setValue(positionModeCombo.getSelectedItem()
1701: .toString());
1702: cssStyleData.modifyProperty(CssStyleData.POSITION, positionData
1703: .toString());
1704: }
1705:
1706: // Variables declaration - do not modify//GEN-BEGIN:variables
1707: private javax.swing.JComboBox clipBottomComboBox;
1708: private javax.swing.JLabel clipBottomLabel;
1709: private javax.swing.JComboBox clipBottomUnitComboBox;
1710: private javax.swing.JPanel clipContainerPanel;
1711: private javax.swing.JLabel clipErrorLabel;
1712: private javax.swing.JPanel clipErrorPanel;
1713: private javax.swing.JComboBox clipLeftComboBox;
1714: private javax.swing.JLabel clipLeftLabel1;
1715: private javax.swing.JComboBox clipLeftUnitComboBox;
1716: private javax.swing.JPanel clipPanel;
1717: private javax.swing.JComboBox clipRightComboBox;
1718: private javax.swing.JLabel clipRightLabel1;
1719: private javax.swing.JComboBox clipRightUnitComboBox;
1720: private javax.swing.JComboBox clipTopComboBox;
1721: private javax.swing.JLabel clipTopLabel1;
1722: private javax.swing.JComboBox clipTopUnitComboBox;
1723: private javax.swing.JPanel containerPanel;
1724: private javax.swing.JLabel errorLabel;
1725: private javax.swing.JPanel errorPanel;
1726: private javax.swing.JPanel fillPanel;
1727: private javax.swing.JComboBox heightComboBox;
1728: private javax.swing.JLabel heightLabel;
1729: private javax.swing.JComboBox heightUnitComboBox;
1730: private javax.swing.JPanel mainPositionPanel;
1731: private javax.swing.JComboBox posBottomComboBox;
1732: private javax.swing.JLabel posBottomLabel1;
1733: private javax.swing.JComboBox posBottomUnitComboBox;
1734: private javax.swing.JComboBox posLeftComboBox;
1735: private javax.swing.JLabel posLeftLabel1;
1736: private javax.swing.JComboBox posLeftUnitComboBox;
1737: private javax.swing.JComboBox posRightComboBox;
1738: private javax.swing.JLabel posRightLabel;
1739: private javax.swing.JComboBox posRightUnitComboBox;
1740: private javax.swing.JComboBox posTopComboBox;
1741: private javax.swing.JLabel posTopLabel;
1742: private javax.swing.JComboBox posTopUnitComboBox;
1743: private javax.swing.JPanel positionContainerPanel;
1744: private javax.swing.JComboBox positionModeCombo;
1745: private javax.swing.JLabel positionModeLabel;
1746: private javax.swing.JPanel positionModePanel;
1747: private javax.swing.JPanel positionPanel;
1748: private javax.swing.JPanel sizeContainerPanel;
1749: private javax.swing.JPanel sizePanel;
1750: private javax.swing.JComboBox visibleComboBox;
1751: private javax.swing.JLabel visibleLabel1;
1752: private javax.swing.JComboBox widthComboBox;
1753: private javax.swing.JLabel widthLabel;
1754: private javax.swing.JComboBox widthUnitComboBox;
1755: private javax.swing.JLabel zIndexLabel1;
1756: private javax.swing.JComboBox zindexComboBox;
1757: // End of variables declaration//GEN-END:variables
1758:
1759: }
|