parent
06e9618a4b
commit
7c88da9d5c
@ -0,0 +1,302 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||||
|
|
||||||
|
<Form version="1.9" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> |
||||||
|
<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,1,44,0,0,1,-112"/> |
||||||
|
</AuxValues> |
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/> |
||||||
|
<SubComponents> |
||||||
|
<Container class="javax.swing.JPanel" name="toolBar"> |
||||||
|
<Properties> |
||||||
|
<Property name="opaque" type="boolean" value="false"/> |
||||||
|
</Properties> |
||||||
|
|
||||||
|
<Layout> |
||||||
|
<DimensionLayout dim="0"> |
||||||
|
<Group type="103" groupAlignment="0" attributes="0"> |
||||||
|
<Group type="102" alignment="0" attributes="0"> |
||||||
|
<Component id="expandButton" min="-2" pref="16" max="-2" attributes="0"/> |
||||||
|
<EmptySpace max="-2" attributes="0"/> |
||||||
|
<Component id="bringToFrontButton" min="-2" pref="16" max="-2" attributes="0"/> |
||||||
|
<EmptySpace max="-2" attributes="0"/> |
||||||
|
<Component id="sphereButton" min="-2" pref="16" max="-2" attributes="0"/> |
||||||
|
<EmptySpace max="-2" attributes="0"/> |
||||||
|
<Component id="boxButton" min="-2" pref="16" max="-2" attributes="0"/> |
||||||
|
<EmptySpace max="-2" attributes="0"/> |
||||||
|
<Component id="quadButton" min="-2" pref="16" max="-2" attributes="0"/> |
||||||
|
<EmptySpace pref="90" max="32767" attributes="0"/> |
||||||
|
<Component id="reloadButton" min="-2" pref="16" max="-2" attributes="0"/> |
||||||
|
</Group> |
||||||
|
</Group> |
||||||
|
</DimensionLayout> |
||||||
|
<DimensionLayout dim="1"> |
||||||
|
<Group type="103" groupAlignment="0" attributes="0"> |
||||||
|
<Component id="expandButton" alignment="0" min="-2" pref="16" max="-2" attributes="0"/> |
||||||
|
<Component id="reloadButton" alignment="0" min="-2" pref="16" max="-2" attributes="0"/> |
||||||
|
<Component id="sphereButton" min="-2" pref="16" max="-2" attributes="0"/> |
||||||
|
<Component id="boxButton" min="-2" pref="16" max="-2" attributes="0"/> |
||||||
|
<Component id="quadButton" min="-2" pref="16" max="-2" attributes="0"/> |
||||||
|
<Component id="bringToFrontButton" alignment="0" min="-2" pref="16" max="-2" attributes="0"/> |
||||||
|
</Group> |
||||||
|
</DimensionLayout> |
||||||
|
</Layout> |
||||||
|
<SubComponents> |
||||||
|
<Component class="javax.swing.JButton" name="reloadButton"> |
||||||
|
<Properties> |
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> |
||||||
|
<Color blue="99" green="99" red="99" 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/reload.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="BackdropPanel.reloadButton.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="[24, 24]"/> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
<Events> |
||||||
|
<EventHandler event="mouseEntered" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="reloadButtonMouseEntered"/> |
||||||
|
<EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="reloadButtonMouseExited"/> |
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="reloadButtonActionPerformed"/> |
||||||
|
</Events> |
||||||
|
</Component> |
||||||
|
<Component class="javax.swing.JButton" name="expandButton"> |
||||||
|
<Properties> |
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> |
||||||
|
<Color blue="99" green="99" red="99" 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/collapse.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="BackdropPanel.expandButton.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="[24, 24]"/> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
<Events> |
||||||
|
<EventHandler event="mouseEntered" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="expandButtonMouseEntered"/> |
||||||
|
<EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="expandButtonMouseExited"/> |
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="expandButtonActionPerformed"/> |
||||||
|
</Events> |
||||||
|
</Component> |
||||||
|
<Component class="javax.swing.JButton" name="sphereButton"> |
||||||
|
<Properties> |
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> |
||||||
|
<Color blue="99" green="99" red="99" 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/Sphere.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="BackdropPanel.sphereButton.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="[24, 24]"/> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
<Events> |
||||||
|
<EventHandler event="mouseEntered" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="sphereButtonMouseEntered"/> |
||||||
|
<EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="sphereButtonMouseExited"/> |
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="sphereButtonActionPerformed"/> |
||||||
|
</Events> |
||||||
|
</Component> |
||||||
|
<Component class="javax.swing.JButton" name="boxButton"> |
||||||
|
<Properties> |
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> |
||||||
|
<Color blue="99" green="99" red="99" 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/cube.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="BackdropPanel.boxButton.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="[24, 24]"/> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
<Events> |
||||||
|
<EventHandler event="mouseEntered" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxButtonMouseEntered"/> |
||||||
|
<EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxButtonMouseExited"/> |
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="boxButtonActionPerformed"/> |
||||||
|
</Events> |
||||||
|
</Component> |
||||||
|
<Component class="javax.swing.JButton" name="quadButton"> |
||||||
|
<Properties> |
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> |
||||||
|
<Color blue="99" green="99" red="99" 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/Quad.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="BackdropPanel.quadButton.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="[24, 24]"/> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
<Events> |
||||||
|
<EventHandler event="mouseEntered" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="quadButtonMouseEntered"/> |
||||||
|
<EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="quadButtonMouseExited"/> |
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="quadButtonActionPerformed"/> |
||||||
|
</Events> |
||||||
|
</Component> |
||||||
|
<Component class="javax.swing.JButton" name="bringToFrontButton"> |
||||||
|
<Properties> |
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> |
||||||
|
<Color blue="99" green="99" red="99" 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/frontBack.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="BackdropPanel.bringToFrontButton.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="[24, 24]"/> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
<Events> |
||||||
|
<EventHandler event="mouseEntered" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="bringToFrontButtonMouseEntered"/> |
||||||
|
<EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="bringToFrontButtonMouseExited"/> |
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bringToFrontButtonActionPerformed"/> |
||||||
|
</Events> |
||||||
|
</Component> |
||||||
|
</SubComponents> |
||||||
|
</Container> |
||||||
|
<Component class="javax.swing.JLabel" name="previewLabel"> |
||||||
|
<Properties> |
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> |
||||||
|
<Color blue="64" green="64" red="64" type="rgb"/> |
||||||
|
</Property> |
||||||
|
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> |
||||||
|
<Color blue="64" green="64" red="64" type="rgb"/> |
||||||
|
</Property> |
||||||
|
<Property name="horizontalAlignment" type="int" value="0"/> |
||||||
|
<Property name="horizontalTextPosition" type="int" value="0"/> |
||||||
|
<Property name="iconTextGap" type="int" value="0"/> |
||||||
|
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
||||||
|
<Dimension value="[100, 100]"/> |
||||||
|
</Property> |
||||||
|
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
||||||
|
<Dimension value="[100, 100]"/> |
||||||
|
</Property> |
||||||
|
<Property name="opaque" type="boolean" value="true"/> |
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
||||||
|
<Dimension value="[100, 100]"/> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
</Component> |
||||||
|
</SubComponents> |
||||||
|
</Form> |
@ -0,0 +1,470 @@ |
|||||||
|
/* |
||||||
|
* 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 com.jme3.gde.materials.MaterialPreviewRenderer; |
||||||
|
import com.jme3.material.Material; |
||||||
|
import java.awt.Container; |
||||||
|
import java.awt.event.ActionEvent; |
||||||
|
import java.awt.event.ActionListener; |
||||||
|
import java.awt.event.ComponentAdapter; |
||||||
|
import java.awt.event.ComponentEvent; |
||||||
|
import java.awt.event.MouseEvent; |
||||||
|
import java.awt.event.MouseListener; |
||||||
|
import javax.swing.JScrollPane; |
||||||
|
import javax.swing.JViewport; |
||||||
|
import javax.swing.SwingUtilities; |
||||||
|
import javax.swing.Timer; |
||||||
|
import javax.swing.event.ChangeEvent; |
||||||
|
import javax.swing.event.ChangeListener; |
||||||
|
|
||||||
|
/** |
||||||
|
* |
||||||
|
* @author Nehon |
||||||
|
*/ |
||||||
|
public class BackdropPanel extends javax.swing.JPanel implements MouseListener, ChangeListener { |
||||||
|
|
||||||
|
private final MaterialPreviewRenderer renderer; |
||||||
|
private Material mat; |
||||||
|
|
||||||
|
/** |
||||||
|
* Creates new form BackdropPanel |
||||||
|
*/ |
||||||
|
@SuppressWarnings("LeakingThisInConstructor") |
||||||
|
public BackdropPanel() { |
||||||
|
initComponents(); |
||||||
|
// setBounds(0, 0, 300, 300);
|
||||||
|
setLayout(null); |
||||||
|
toolBar.setVisible(false); |
||||||
|
addMouseListener(this); |
||||||
|
renderer = new MaterialPreviewRenderer(previewLabel); |
||||||
|
recalculateTimer.setRepeats(false); |
||||||
|
addComponentListener(new ComponentAdapter() { |
||||||
|
|
||||||
|
@Override |
||||||
|
public void componentResized(ComponentEvent e) { |
||||||
|
updateComponents(e); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void componentShown(ComponentEvent e) { |
||||||
|
updateComponents(e); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void componentMoved(ComponentEvent e) { |
||||||
|
updateComponents(e); |
||||||
|
} |
||||||
|
|
||||||
|
}); |
||||||
|
|
||||||
|
previewLabel.setBounds(0, 0, 120, 120); |
||||||
|
toolBar.setBounds(0, 0, 120, 16); |
||||||
|
repaint(); |
||||||
|
} |
||||||
|
|
||||||
|
private void updateComponents(ComponentEvent e) { |
||||||
|
previewLabel.setBounds(0, 0, e.getComponent().getWidth(), e.getComponent().getHeight()); |
||||||
|
toolBar.setBounds(0, 0, e.getComponent().getWidth(), toolBar.getHeight()); |
||||||
|
repaint(); |
||||||
|
} |
||||||
|
|
||||||
|
public void cleanup() { |
||||||
|
renderer.cleanUp(); |
||||||
|
} |
||||||
|
|
||||||
|
public void showMaterial(Material mat) { |
||||||
|
if (isVisible()) { |
||||||
|
this.mat = mat; |
||||||
|
renderer.showMaterial(mat); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 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() { |
||||||
|
|
||||||
|
toolBar = new javax.swing.JPanel(); |
||||||
|
reloadButton = new javax.swing.JButton(); |
||||||
|
expandButton = new javax.swing.JButton(); |
||||||
|
sphereButton = new javax.swing.JButton(); |
||||||
|
boxButton = new javax.swing.JButton(); |
||||||
|
quadButton = new javax.swing.JButton(); |
||||||
|
bringToFrontButton = new javax.swing.JButton(); |
||||||
|
previewLabel = new javax.swing.JLabel(); |
||||||
|
|
||||||
|
toolBar.setOpaque(false); |
||||||
|
|
||||||
|
reloadButton.setBackground(new java.awt.Color(153, 153, 153)); |
||||||
|
reloadButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/reload.png"))); // NOI18N
|
||||||
|
reloadButton.setToolTipText(org.openide.util.NbBundle.getMessage(BackdropPanel.class, "BackdropPanel.reloadButton.toolTipText")); // NOI18N
|
||||||
|
reloadButton.setBorder(null); |
||||||
|
reloadButton.setBorderPainted(false); |
||||||
|
reloadButton.setContentAreaFilled(false); |
||||||
|
reloadButton.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); |
||||||
|
reloadButton.setFocusable(false); |
||||||
|
reloadButton.setIconTextGap(0); |
||||||
|
reloadButton.setMaximumSize(new java.awt.Dimension(24, 24)); |
||||||
|
reloadButton.setMinimumSize(new java.awt.Dimension(24, 24)); |
||||||
|
reloadButton.setPreferredSize(new java.awt.Dimension(24, 24)); |
||||||
|
reloadButton.addMouseListener(new java.awt.event.MouseAdapter() { |
||||||
|
public void mouseEntered(java.awt.event.MouseEvent evt) { |
||||||
|
reloadButtonMouseEntered(evt); |
||||||
|
} |
||||||
|
public void mouseExited(java.awt.event.MouseEvent evt) { |
||||||
|
reloadButtonMouseExited(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
reloadButton.addActionListener(new java.awt.event.ActionListener() { |
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) { |
||||||
|
reloadButtonActionPerformed(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
expandButton.setBackground(new java.awt.Color(153, 153, 153)); |
||||||
|
expandButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/collapse.png"))); // NOI18N
|
||||||
|
expandButton.setToolTipText(org.openide.util.NbBundle.getMessage(BackdropPanel.class, "BackdropPanel.expandButton.toolTipText")); // NOI18N
|
||||||
|
expandButton.setBorder(null); |
||||||
|
expandButton.setBorderPainted(false); |
||||||
|
expandButton.setContentAreaFilled(false); |
||||||
|
expandButton.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); |
||||||
|
expandButton.setFocusable(false); |
||||||
|
expandButton.setIconTextGap(0); |
||||||
|
expandButton.setMaximumSize(new java.awt.Dimension(24, 24)); |
||||||
|
expandButton.setMinimumSize(new java.awt.Dimension(24, 24)); |
||||||
|
expandButton.setPreferredSize(new java.awt.Dimension(24, 24)); |
||||||
|
expandButton.addMouseListener(new java.awt.event.MouseAdapter() { |
||||||
|
public void mouseEntered(java.awt.event.MouseEvent evt) { |
||||||
|
expandButtonMouseEntered(evt); |
||||||
|
} |
||||||
|
public void mouseExited(java.awt.event.MouseEvent evt) { |
||||||
|
expandButtonMouseExited(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
expandButton.addActionListener(new java.awt.event.ActionListener() { |
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) { |
||||||
|
expandButtonActionPerformed(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
sphereButton.setBackground(new java.awt.Color(153, 153, 153)); |
||||||
|
sphereButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/Sphere.png"))); // NOI18N
|
||||||
|
sphereButton.setToolTipText(org.openide.util.NbBundle.getMessage(BackdropPanel.class, "BackdropPanel.sphereButton.toolTipText")); // NOI18N
|
||||||
|
sphereButton.setBorder(null); |
||||||
|
sphereButton.setBorderPainted(false); |
||||||
|
sphereButton.setContentAreaFilled(false); |
||||||
|
sphereButton.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); |
||||||
|
sphereButton.setFocusable(false); |
||||||
|
sphereButton.setIconTextGap(0); |
||||||
|
sphereButton.setMaximumSize(new java.awt.Dimension(24, 24)); |
||||||
|
sphereButton.setMinimumSize(new java.awt.Dimension(24, 24)); |
||||||
|
sphereButton.setPreferredSize(new java.awt.Dimension(24, 24)); |
||||||
|
sphereButton.addMouseListener(new java.awt.event.MouseAdapter() { |
||||||
|
public void mouseEntered(java.awt.event.MouseEvent evt) { |
||||||
|
sphereButtonMouseEntered(evt); |
||||||
|
} |
||||||
|
public void mouseExited(java.awt.event.MouseEvent evt) { |
||||||
|
sphereButtonMouseExited(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
sphereButton.addActionListener(new java.awt.event.ActionListener() { |
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) { |
||||||
|
sphereButtonActionPerformed(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
boxButton.setBackground(new java.awt.Color(153, 153, 153)); |
||||||
|
boxButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/cube.png"))); // NOI18N
|
||||||
|
boxButton.setToolTipText(org.openide.util.NbBundle.getMessage(BackdropPanel.class, "BackdropPanel.boxButton.toolTipText")); // NOI18N
|
||||||
|
boxButton.setBorder(null); |
||||||
|
boxButton.setBorderPainted(false); |
||||||
|
boxButton.setContentAreaFilled(false); |
||||||
|
boxButton.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); |
||||||
|
boxButton.setFocusable(false); |
||||||
|
boxButton.setIconTextGap(0); |
||||||
|
boxButton.setMaximumSize(new java.awt.Dimension(24, 24)); |
||||||
|
boxButton.setMinimumSize(new java.awt.Dimension(24, 24)); |
||||||
|
boxButton.setPreferredSize(new java.awt.Dimension(24, 24)); |
||||||
|
boxButton.addMouseListener(new java.awt.event.MouseAdapter() { |
||||||
|
public void mouseEntered(java.awt.event.MouseEvent evt) { |
||||||
|
boxButtonMouseEntered(evt); |
||||||
|
} |
||||||
|
public void mouseExited(java.awt.event.MouseEvent evt) { |
||||||
|
boxButtonMouseExited(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
boxButton.addActionListener(new java.awt.event.ActionListener() { |
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) { |
||||||
|
boxButtonActionPerformed(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
quadButton.setBackground(new java.awt.Color(153, 153, 153)); |
||||||
|
quadButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/Quad.png"))); // NOI18N
|
||||||
|
quadButton.setToolTipText(org.openide.util.NbBundle.getMessage(BackdropPanel.class, "BackdropPanel.quadButton.toolTipText")); // NOI18N
|
||||||
|
quadButton.setBorder(null); |
||||||
|
quadButton.setBorderPainted(false); |
||||||
|
quadButton.setContentAreaFilled(false); |
||||||
|
quadButton.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); |
||||||
|
quadButton.setFocusable(false); |
||||||
|
quadButton.setIconTextGap(0); |
||||||
|
quadButton.setMaximumSize(new java.awt.Dimension(24, 24)); |
||||||
|
quadButton.setMinimumSize(new java.awt.Dimension(24, 24)); |
||||||
|
quadButton.setPreferredSize(new java.awt.Dimension(24, 24)); |
||||||
|
quadButton.addMouseListener(new java.awt.event.MouseAdapter() { |
||||||
|
public void mouseEntered(java.awt.event.MouseEvent evt) { |
||||||
|
quadButtonMouseEntered(evt); |
||||||
|
} |
||||||
|
public void mouseExited(java.awt.event.MouseEvent evt) { |
||||||
|
quadButtonMouseExited(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
quadButton.addActionListener(new java.awt.event.ActionListener() { |
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) { |
||||||
|
quadButtonActionPerformed(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
bringToFrontButton.setBackground(new java.awt.Color(153, 153, 153)); |
||||||
|
bringToFrontButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/frontBack.png"))); // NOI18N
|
||||||
|
bringToFrontButton.setToolTipText(org.openide.util.NbBundle.getMessage(BackdropPanel.class, "BackdropPanel.bringToFrontButton.toolTipText")); // NOI18N
|
||||||
|
bringToFrontButton.setBorder(null); |
||||||
|
bringToFrontButton.setBorderPainted(false); |
||||||
|
bringToFrontButton.setContentAreaFilled(false); |
||||||
|
bringToFrontButton.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); |
||||||
|
bringToFrontButton.setFocusable(false); |
||||||
|
bringToFrontButton.setIconTextGap(0); |
||||||
|
bringToFrontButton.setMaximumSize(new java.awt.Dimension(24, 24)); |
||||||
|
bringToFrontButton.setMinimumSize(new java.awt.Dimension(24, 24)); |
||||||
|
bringToFrontButton.setPreferredSize(new java.awt.Dimension(24, 24)); |
||||||
|
bringToFrontButton.addMouseListener(new java.awt.event.MouseAdapter() { |
||||||
|
public void mouseEntered(java.awt.event.MouseEvent evt) { |
||||||
|
bringToFrontButtonMouseEntered(evt); |
||||||
|
} |
||||||
|
public void mouseExited(java.awt.event.MouseEvent evt) { |
||||||
|
bringToFrontButtonMouseExited(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
bringToFrontButton.addActionListener(new java.awt.event.ActionListener() { |
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) { |
||||||
|
bringToFrontButtonActionPerformed(evt); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
javax.swing.GroupLayout toolBarLayout = new javax.swing.GroupLayout(toolBar); |
||||||
|
toolBar.setLayout(toolBarLayout); |
||||||
|
toolBarLayout.setHorizontalGroup( |
||||||
|
toolBarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
||||||
|
.addGroup(toolBarLayout.createSequentialGroup() |
||||||
|
.addComponent(expandButton, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) |
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
||||||
|
.addComponent(bringToFrontButton, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) |
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
||||||
|
.addComponent(sphereButton, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) |
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
||||||
|
.addComponent(boxButton, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) |
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
||||||
|
.addComponent(quadButton, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) |
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 90, Short.MAX_VALUE) |
||||||
|
.addComponent(reloadButton, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)) |
||||||
|
); |
||||||
|
toolBarLayout.setVerticalGroup( |
||||||
|
toolBarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
||||||
|
.addComponent(expandButton, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) |
||||||
|
.addComponent(reloadButton, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) |
||||||
|
.addComponent(sphereButton, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) |
||||||
|
.addComponent(boxButton, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) |
||||||
|
.addComponent(quadButton, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) |
||||||
|
.addComponent(bringToFrontButton, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) |
||||||
|
); |
||||||
|
|
||||||
|
add(toolBar); |
||||||
|
|
||||||
|
previewLabel.setBackground(new java.awt.Color(100, 100, 100)); |
||||||
|
previewLabel.setForeground(new java.awt.Color(100, 100, 100)); |
||||||
|
previewLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); |
||||||
|
previewLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); |
||||||
|
previewLabel.setIconTextGap(0); |
||||||
|
previewLabel.setMaximumSize(new java.awt.Dimension(100, 100)); |
||||||
|
previewLabel.setMinimumSize(new java.awt.Dimension(100, 100)); |
||||||
|
previewLabel.setOpaque(true); |
||||||
|
previewLabel.setPreferredSize(new java.awt.Dimension(100, 100)); |
||||||
|
add(previewLabel); |
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void sphereButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_sphereButtonMouseEntered
|
||||||
|
mouseEntered(SwingUtilities.convertMouseEvent(sphereButton, evt, this)); |
||||||
|
}//GEN-LAST:event_sphereButtonMouseEntered
|
||||||
|
|
||||||
|
private void sphereButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_sphereButtonMouseExited
|
||||||
|
mouseExited(SwingUtilities.convertMouseEvent(sphereButton, evt, this)); |
||||||
|
}//GEN-LAST:event_sphereButtonMouseExited
|
||||||
|
|
||||||
|
private void sphereButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sphereButtonActionPerformed
|
||||||
|
renderer.switchDisplay(MaterialPreviewRenderer.DisplayType.Sphere); |
||||||
|
refresh(); |
||||||
|
}//GEN-LAST:event_sphereButtonActionPerformed
|
||||||
|
|
||||||
|
private void boxButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxButtonMouseEntered
|
||||||
|
mouseEntered(SwingUtilities.convertMouseEvent(boxButton, evt, this)); |
||||||
|
}//GEN-LAST:event_boxButtonMouseEntered
|
||||||
|
|
||||||
|
private void boxButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxButtonMouseExited
|
||||||
|
mouseExited(SwingUtilities.convertMouseEvent(boxButton, evt, this)); |
||||||
|
}//GEN-LAST:event_boxButtonMouseExited
|
||||||
|
|
||||||
|
private void boxButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boxButtonActionPerformed
|
||||||
|
renderer.switchDisplay(MaterialPreviewRenderer.DisplayType.Box); |
||||||
|
refresh(); |
||||||
|
}//GEN-LAST:event_boxButtonActionPerformed
|
||||||
|
|
||||||
|
private void reloadButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadButtonMouseEntered
|
||||||
|
mouseEntered(SwingUtilities.convertMouseEvent(reloadButton, evt, this)); |
||||||
|
}//GEN-LAST:event_reloadButtonMouseEntered
|
||||||
|
|
||||||
|
private void reloadButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadButtonMouseExited
|
||||||
|
mouseExited(SwingUtilities.convertMouseEvent(reloadButton, evt, this)); |
||||||
|
}//GEN-LAST:event_reloadButtonMouseExited
|
||||||
|
|
||||||
|
private void reloadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reloadButtonActionPerformed
|
||||||
|
refresh(); |
||||||
|
}//GEN-LAST:event_reloadButtonActionPerformed
|
||||||
|
|
||||||
|
private void quadButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_quadButtonMouseEntered
|
||||||
|
mouseEntered(SwingUtilities.convertMouseEvent(quadButton, evt, this)); |
||||||
|
}//GEN-LAST:event_quadButtonMouseEntered
|
||||||
|
|
||||||
|
private void quadButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_quadButtonMouseExited
|
||||||
|
mouseExited(SwingUtilities.convertMouseEvent(quadButton, evt, this)); |
||||||
|
}//GEN-LAST:event_quadButtonMouseExited
|
||||||
|
|
||||||
|
private void quadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_quadButtonActionPerformed
|
||||||
|
renderer.switchDisplay(MaterialPreviewRenderer.DisplayType.Quad); |
||||||
|
refresh(); |
||||||
|
}//GEN-LAST:event_quadButtonActionPerformed
|
||||||
|
|
||||||
|
private void expandButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_expandButtonMouseEntered
|
||||||
|
mouseEntered(SwingUtilities.convertMouseEvent(expandButton, evt, this)); |
||||||
|
}//GEN-LAST:event_expandButtonMouseEntered
|
||||||
|
|
||||||
|
private void expandButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_expandButtonMouseExited
|
||||||
|
mouseExited(SwingUtilities.convertMouseEvent(expandButton, evt, this)); |
||||||
|
}//GEN-LAST:event_expandButtonMouseExited
|
||||||
|
|
||||||
|
private void expandButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_expandButtonActionPerformed
|
||||||
|
setVisible(false); |
||||||
|
}//GEN-LAST:event_expandButtonActionPerformed
|
||||||
|
|
||||||
|
private void bringToFrontButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bringToFrontButtonMouseEntered
|
||||||
|
mouseEntered(SwingUtilities.convertMouseEvent(bringToFrontButton, evt, this)); |
||||||
|
}//GEN-LAST:event_bringToFrontButtonMouseEntered
|
||||||
|
|
||||||
|
private void bringToFrontButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bringToFrontButtonMouseExited
|
||||||
|
mouseExited(SwingUtilities.convertMouseEvent(bringToFrontButton, evt, this)); |
||||||
|
}//GEN-LAST:event_bringToFrontButtonMouseExited
|
||||||
|
|
||||||
|
private void bringToFrontButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bringToFrontButtonActionPerformed
|
||||||
|
Diagram diagram = ((Diagram) getParent()); |
||||||
|
if (diagram.getComponentZOrder(this) > 0) { |
||||||
|
diagram.setComponentZOrder(this, 0); |
||||||
|
} else { |
||||||
|
diagram.setComponentZOrder(this, ((Diagram) getParent()).getComponentCount() - 1); |
||||||
|
} |
||||||
|
diagram.repaint(); |
||||||
|
}//GEN-LAST:event_bringToFrontButtonActionPerformed
|
||||||
|
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JButton boxButton; |
||||||
|
private javax.swing.JButton bringToFrontButton; |
||||||
|
private javax.swing.JButton expandButton; |
||||||
|
private javax.swing.JLabel previewLabel; |
||||||
|
private javax.swing.JButton quadButton; |
||||||
|
private javax.swing.JButton reloadButton; |
||||||
|
private javax.swing.JButton sphereButton; |
||||||
|
private javax.swing.JPanel toolBar; |
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
|
@Override |
||||||
|
public void mouseClicked(MouseEvent e) { |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void mousePressed(MouseEvent e) { |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void mouseReleased(MouseEvent e) { |
||||||
|
Container c = getParent(); |
||||||
|
if (c != null) { |
||||||
|
((MouseListener) c).mouseReleased(SwingUtilities.convertMouseEvent(this, e, c)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void mouseEntered(MouseEvent e) { |
||||||
|
toolBar.setVisible(true); |
||||||
|
t.stop(); |
||||||
|
} |
||||||
|
Timer t = new Timer(500, new ActionListener() { |
||||||
|
@Override |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
toolBar.setVisible(false); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
@Override |
||||||
|
public void mouseExited(MouseEvent e) { |
||||||
|
t.restart(); |
||||||
|
} |
||||||
|
|
||||||
|
public void stateChanged(ChangeEvent e) { |
||||||
|
JViewport vp = (JViewport) e.getSource(); |
||||||
|
update(vp); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
private final Timer recalculateTimer = new Timer(20, new ActionListener() { |
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
refresh(); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
protected void update(JViewport viewPort) { |
||||||
|
if (isVisible()) { |
||||||
|
JScrollPane pane = (JScrollPane) viewPort.getParent(); |
||||||
|
int width = viewPort.getWidth(); |
||||||
|
int height = viewPort.getHeight(); |
||||||
|
|
||||||
|
int size = Math.min(width, height) - 25; |
||||||
|
setSize(size, size); |
||||||
|
setBounds(0, 0, size, size); |
||||||
|
|
||||||
|
setLocation(pane.getHorizontalScrollBar().getValue() + width / 2 - size / 2, pane.getVerticalScrollBar().getValue() + height / 2 - size / 2); |
||||||
|
|
||||||
|
repaint(); |
||||||
|
if (recalculateTimer.isRunning()) { |
||||||
|
recalculateTimer.restart(); |
||||||
|
} else { |
||||||
|
recalculateTimer.start(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
private void refresh() { |
||||||
|
if (mat != null) { |
||||||
|
renderer.showMaterial(mat); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
After Width: | Height: | Size: 333 B |
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue