parent
629c007cd4
commit
ae8474cb57
@ -0,0 +1,201 @@ |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
||||
<Form version="1.8" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> |
||||
<Properties> |
||||
<Property name="opaque" type="boolean" value="false"/> |
||||
</Properties> |
||||
<AuxValues> |
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/> |
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> |
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> |
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/> |
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/> |
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> |
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> |
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> |
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> |
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,24,0,0,1,-128"/> |
||||
</AuxValues> |
||||
<SubComponents> |
||||
<Component class="javax.swing.JButton" name="codeButton"> |
||||
<Properties> |
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> |
||||
<Color blue="ff" green="ff" red="ff" type="rgb"/> |
||||
</Property> |
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> |
||||
<Image iconType="3" name="/com/jme3/gde/materialdefinition/icons/code.png"/> |
||||
</Property> |
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> |
||||
<ResourceString bundle="com/jme3/gde/materialdefinition/editor/Bundle.properties" key="NodeToolBar.codeButton.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> |
||||
</Property> |
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> |
||||
<Border info="null"/> |
||||
</Property> |
||||
<Property name="borderPainted" type="boolean" value="false"/> |
||||
<Property name="contentAreaFilled" type="boolean" value="false"/> |
||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> |
||||
<Color id="Curseur par défaut"/> |
||||
</Property> |
||||
<Property name="focusable" type="boolean" value="false"/> |
||||
<Property name="iconTextGap" type="int" value="0"/> |
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
||||
<Dimension value="[24, 24]"/> |
||||
</Property> |
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
||||
<Dimension value="[24, 24]"/> |
||||
</Property> |
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
||||
<Dimension value="[16, 16]"/> |
||||
</Property> |
||||
<Property name="rolloverIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> |
||||
<Image iconType="3" name="/com/jme3/gde/materialdefinition/icons/codeHover.png"/> |
||||
</Property> |
||||
</Properties> |
||||
<Events> |
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="codeButtonActionPerformed"/> |
||||
</Events> |
||||
<Constraints> |
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |
||||
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/> |
||||
</Constraint> |
||||
</Constraints> |
||||
</Component> |
||||
<Component class="javax.swing.JButton" name="deleteButton"> |
||||
<Properties> |
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> |
||||
<Color blue="ff" green="ff" red="ff" type="rgb"/> |
||||
</Property> |
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> |
||||
<Image iconType="3" name="/com/jme3/gde/materialdefinition/icons/deleteNode.png"/> |
||||
</Property> |
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> |
||||
<ResourceString bundle="com/jme3/gde/materialdefinition/editor/Bundle.properties" key="NodeToolBar.deleteButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> |
||||
</Property> |
||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> |
||||
<ResourceString bundle="com/jme3/gde/materialdefinition/editor/Bundle.properties" key="NodeToolBar.deleteButton.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> |
||||
</Property> |
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> |
||||
<Border info="null"/> |
||||
</Property> |
||||
<Property name="borderPainted" type="boolean" value="false"/> |
||||
<Property name="contentAreaFilled" type="boolean" value="false"/> |
||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> |
||||
<Color id="Curseur par défaut"/> |
||||
</Property> |
||||
<Property name="focusable" type="boolean" value="false"/> |
||||
<Property name="iconTextGap" type="int" value="0"/> |
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
||||
<Dimension value="[24, 24]"/> |
||||
</Property> |
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
||||
<Dimension value="[24, 24]"/> |
||||
</Property> |
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
||||
<Dimension value="[16, 16]"/> |
||||
</Property> |
||||
<Property name="rolloverIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> |
||||
<Image iconType="3" name="/com/jme3/gde/materialdefinition/icons/deleteNodeHover.png"/> |
||||
</Property> |
||||
</Properties> |
||||
<Events> |
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteButtonActionPerformed"/> |
||||
</Events> |
||||
<Constraints> |
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |
||||
<GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/> |
||||
</Constraint> |
||||
</Constraints> |
||||
</Component> |
||||
</SubComponents> |
||||
<LayoutCode> |
||||
<CodeStatement> |
||||
<CodeExpression id="1_layout"> |
||||
<CodeVariable name="layout" type="4096" declaredType="java.awt.GridBagLayout"/> |
||||
<ExpressionOrigin> |
||||
<ExpressionProvider type="CodeConstructor"> |
||||
<CodeConstructor class="java.awt.GridBagLayout" parameterTypes=""/> |
||||
</ExpressionProvider> |
||||
</ExpressionOrigin> |
||||
</CodeExpression> |
||||
<StatementProvider type="CodeExpression"> |
||||
<CodeExpression id="1_layout"/> |
||||
</StatementProvider> |
||||
</CodeStatement> |
||||
<CodeStatement> |
||||
<CodeExpression id="1_layout"/> |
||||
<StatementProvider type="CodeField"> |
||||
<CodeField name="rowHeights" class="java.awt.GridBagLayout"/> |
||||
</StatementProvider> |
||||
<Parameters> |
||||
<CodeExpression id="2"> |
||||
<ExpressionOrigin> |
||||
<Value type="[I" editor="org.netbeans.modules.form.layoutsupport.delegates.GridBagLayoutSupport$IntArrayPropertyEditor"> |
||||
<PropertyValue value="[16]"/> |
||||
</Value> |
||||
</ExpressionOrigin> |
||||
</CodeExpression> |
||||
</Parameters> |
||||
</CodeStatement> |
||||
<CodeStatement> |
||||
<CodeExpression id="3"> |
||||
<ExpressionOrigin> |
||||
<ExpressionProvider type="ComponentRef"> |
||||
<ComponentRef name="."/> |
||||
</ExpressionProvider> |
||||
</ExpressionOrigin> |
||||
</CodeExpression> |
||||
<StatementProvider type="CodeMethod"> |
||||
<CodeMethod name="setLayout" class="java.awt.Container" parameterTypes="java.awt.LayoutManager"/> |
||||
</StatementProvider> |
||||
<Parameters> |
||||
<CodeExpression id="1_layout"/> |
||||
</Parameters> |
||||
</CodeStatement> |
||||
<CodeStatement> |
||||
<CodeExpression id="3"/> |
||||
<StatementProvider type="CodeMethod"> |
||||
<CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/> |
||||
</StatementProvider> |
||||
<Parameters> |
||||
<CodeExpression id="4_codeButton"> |
||||
<CodeVariable name="codeButton" type="8194" declaredType="javax.swing.JButton"/> |
||||
<ExpressionOrigin> |
||||
<ExpressionProvider type="ComponentRef"> |
||||
<ComponentRef name="codeButton"/> |
||||
</ExpressionProvider> |
||||
</ExpressionOrigin> |
||||
</CodeExpression> |
||||
<CodeExpression id="5"> |
||||
<ExpressionOrigin> |
||||
<ExpressionProvider type="CodeConstructor"> |
||||
<CodeConstructor class="java.awt.GridBagConstraints" parameterTypes=""/> |
||||
</ExpressionProvider> |
||||
</ExpressionOrigin> |
||||
</CodeExpression> |
||||
</Parameters> |
||||
</CodeStatement> |
||||
<CodeStatement> |
||||
<CodeExpression id="3"/> |
||||
<StatementProvider type="CodeMethod"> |
||||
<CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/> |
||||
</StatementProvider> |
||||
<Parameters> |
||||
<CodeExpression id="6_deleteButton"> |
||||
<CodeVariable name="deleteButton" type="8194" declaredType="javax.swing.JButton"/> |
||||
<ExpressionOrigin> |
||||
<ExpressionProvider type="ComponentRef"> |
||||
<ComponentRef name="deleteButton"/> |
||||
</ExpressionProvider> |
||||
</ExpressionOrigin> |
||||
</CodeExpression> |
||||
<CodeExpression id="7"> |
||||
<ExpressionOrigin> |
||||
<ExpressionProvider type="CodeConstructor"> |
||||
<CodeConstructor class="java.awt.GridBagConstraints" parameterTypes=""/> |
||||
</ExpressionProvider> |
||||
</ExpressionOrigin> |
||||
</CodeExpression> |
||||
</Parameters> |
||||
</CodeStatement> |
||||
</LayoutCode> |
||||
</Form> |
@ -0,0 +1,147 @@ |
||||
/* |
||||
* To change this license header, choose License Headers in Project Properties. |
||||
* To change this template file, choose Tools | Templates |
||||
* and open the template in the editor. |
||||
*/ |
||||
package com.jme3.gde.materialdefinition.editor; |
||||
|
||||
import java.awt.event.ComponentEvent; |
||||
import java.awt.event.ComponentListener; |
||||
import java.awt.event.MouseEvent; |
||||
import java.awt.event.MouseListener; |
||||
|
||||
/** |
||||
* |
||||
* @author Nehon |
||||
*/ |
||||
public class NodeToolBar extends javax.swing.JPanel implements ComponentListener, MouseListener { |
||||
|
||||
private final NodePanel node; |
||||
|
||||
/** |
||||
* Creates new form NodeToolBar |
||||
*/ |
||||
@SuppressWarnings("LeakingThisInConstructor") |
||||
public NodeToolBar(NodePanel node) { |
||||
initComponents(); |
||||
this.node = node; |
||||
node.addComponentListener(this); |
||||
} |
||||
|
||||
/** |
||||
* This method is called from within the constructor to initialize the form. |
||||
* WARNING: Do NOT modify this code. The content of this method is always |
||||
* regenerated by the Form Editor. |
||||
*/ |
||||
@SuppressWarnings("unchecked") |
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() { |
||||
|
||||
codeButton = new javax.swing.JButton(); |
||||
deleteButton = new javax.swing.JButton(); |
||||
|
||||
setOpaque(false); |
||||
java.awt.GridBagLayout layout = new java.awt.GridBagLayout(); |
||||
layout.rowHeights = new int[] {16}; |
||||
setLayout(layout); |
||||
|
||||
codeButton.setBackground(new java.awt.Color(255, 255, 255)); |
||||
codeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/code.png"))); // NOI18N
|
||||
codeButton.setToolTipText(org.openide.util.NbBundle.getMessage(NodeToolBar.class, "NodeToolBar.codeButton.toolTipText")); // NOI18N
|
||||
codeButton.setBorder(null); |
||||
codeButton.setBorderPainted(false); |
||||
codeButton.setContentAreaFilled(false); |
||||
codeButton.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); |
||||
codeButton.setFocusable(false); |
||||
codeButton.setIconTextGap(0); |
||||
codeButton.setMaximumSize(new java.awt.Dimension(24, 24)); |
||||
codeButton.setMinimumSize(new java.awt.Dimension(24, 24)); |
||||
codeButton.setPreferredSize(new java.awt.Dimension(16, 16)); |
||||
codeButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/codeHover.png"))); // NOI18N
|
||||
codeButton.addActionListener(new java.awt.event.ActionListener() { |
||||
public void actionPerformed(java.awt.event.ActionEvent evt) { |
||||
codeButtonActionPerformed(evt); |
||||
} |
||||
}); |
||||
add(codeButton, new java.awt.GridBagConstraints()); |
||||
|
||||
deleteButton.setBackground(new java.awt.Color(255, 255, 255)); |
||||
deleteButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/deleteNode.png"))); // NOI18N
|
||||
org.openide.awt.Mnemonics.setLocalizedText(deleteButton, org.openide.util.NbBundle.getMessage(NodeToolBar.class, "NodeToolBar.deleteButton.text")); // NOI18N
|
||||
deleteButton.setToolTipText(org.openide.util.NbBundle.getMessage(NodeToolBar.class, "NodeToolBar.deleteButton.toolTipText")); // NOI18N
|
||||
deleteButton.setBorder(null); |
||||
deleteButton.setBorderPainted(false); |
||||
deleteButton.setContentAreaFilled(false); |
||||
deleteButton.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); |
||||
deleteButton.setFocusable(false); |
||||
deleteButton.setIconTextGap(0); |
||||
deleteButton.setMaximumSize(new java.awt.Dimension(24, 24)); |
||||
deleteButton.setMinimumSize(new java.awt.Dimension(24, 24)); |
||||
deleteButton.setPreferredSize(new java.awt.Dimension(16, 16)); |
||||
deleteButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/deleteNodeHover.png"))); // NOI18N
|
||||
deleteButton.addActionListener(new java.awt.event.ActionListener() { |
||||
public void actionPerformed(java.awt.event.ActionEvent evt) { |
||||
deleteButtonActionPerformed(evt); |
||||
} |
||||
}); |
||||
add(deleteButton, new java.awt.GridBagConstraints()); |
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void codeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_codeButtonActionPerformed
|
||||
node.edit(); |
||||
}//GEN-LAST:event_codeButtonActionPerformed
|
||||
|
||||
private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed
|
||||
node.delete(); |
||||
}//GEN-LAST:event_deleteButtonActionPerformed
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton codeButton; |
||||
private javax.swing.JButton deleteButton; |
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
public void display() { |
||||
if (getParent() == null) { |
||||
node.getParent().add(this); |
||||
} |
||||
setBounds(node.getLocation().x + 5, node.getLocation().y - 18, node.getWidth() - 10, 16); |
||||
node.getParent().setComponentZOrder(this, 0); |
||||
setVisible(true); |
||||
|
||||
} |
||||
|
||||
public void componentResized(ComponentEvent e) { |
||||
} |
||||
|
||||
public void componentMoved(ComponentEvent e) { |
||||
setLocation(node.getLocation().x + 5, node.getLocation().y - 18); |
||||
} |
||||
|
||||
public void componentShown(ComponentEvent e) { |
||||
} |
||||
|
||||
public void componentHidden(ComponentEvent e) { |
||||
} |
||||
|
||||
public void mouseClicked(MouseEvent e) { |
||||
e.consume(); |
||||
} |
||||
|
||||
public void mousePressed(MouseEvent e) { |
||||
e.consume(); |
||||
} |
||||
|
||||
public void mouseReleased(MouseEvent e) { |
||||
e.consume(); |
||||
} |
||||
|
||||
public void mouseEntered(MouseEvent e) { |
||||
|
||||
} |
||||
|
||||
public void mouseExited(MouseEvent e) { |
||||
|
||||
} |
||||
|
||||
} |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
Loading…
Reference in new issue