⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 waterpasseditor.java

📁 java 3d game jme 工程开发源代码
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
            public void actionPerformed(final ActionEvent e) {
                Callable<?> exe = new Callable() {
                    public Object call() {
                        try {
                            pass.setUseReflection(enableReflectionBox.isSelected());
                        } catch (Exception ex) {
                            logger.log(Level.SEVERE,
                                    "Water Editor Error Caught", ex);
                        }
                        return null;
                    }
                };
                GameTaskQueueManager.getManager().getQueue(GameTaskQueue.RENDER).enqueue(exe);
            }
        });
        enableReflectionBox.setBorder(new EmptyBorder(0, 0, 0, 0));
        enableReflectionBox
                .setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
        enableReflectionBox.setText("Enable:");
        final GridBagConstraints gridBagConstraints_11 = new GridBagConstraints();
        gridBagConstraints_11.gridwidth = 2;
        gridBagConstraints_11.weightx = 1;
        gridBagConstraints_11.anchor = GridBagConstraints.WEST;
        gridBagConstraints_11.gridy = 0;
        gridBagConstraints_11.gridx = 0;
        reflectPanel.add(enableReflectionBox, gridBagConstraints_11);

        final JLabel reflectionSpeedLabel = new JLabel();
        reflectionSpeedLabel.setText("Reflection Speed:");
        final GridBagConstraints gridBagConstraints_13 = new GridBagConstraints();
        gridBagConstraints_13.gridy = 1;
        gridBagConstraints_13.gridx = 0;
        reflectPanel.add(reflectionSpeedLabel, gridBagConstraints_13);

        reflectField = new ValueSpinner(-1000, 1000, .01f);
        reflectField.setValue(pass.getSpeedReflection());
        reflectField.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
                pass.setSpeedReflection(((Number) reflectField.getValue())
                        .floatValue());
            }
        });
        final GridBagConstraints gridBagConstraints_15 = new GridBagConstraints();
        gridBagConstraints_15.insets = new Insets(0, 4, 0, 0);
        gridBagConstraints_15.gridy = 1;
        gridBagConstraints_15.gridx = 1;
        reflectPanel.add(reflectField, gridBagConstraints_15);

        final JPanel refractPanel = new JPanel();
        refractPanel.setBorder(new TitledBorder(null, "Refraction",
                TitledBorder.DEFAULT_JUSTIFICATION,
                TitledBorder.DEFAULT_POSITION, null, null));
        refractPanel.setLayout(new GridBagLayout());
        final GridBagConstraints gridBagConstraints_9 = new GridBagConstraints();
        gridBagConstraints_9.weightx = 0;
        gridBagConstraints_9.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints_9.gridy = 2;
        gridBagConstraints_9.gridx = 1;
        add(refractPanel, gridBagConstraints_9);

        enableRefractionBox = new JCheckBox();
        enableRefractionBox.setSelected(pass.isUseRefraction());
        enableRefractionBox.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
                Callable<?> exe = new Callable() {
                    public Object call() {
                        try {
                            pass.setUseRefraction(enableRefractionBox.isSelected());
                        } catch (Exception ex) {
                            logger.log(Level.SEVERE,
                                    "Water Editor Error Caught", ex);
                        }
                        return null;
                    }
                };
                GameTaskQueueManager.getManager().getQueue(GameTaskQueue.RENDER).enqueue(exe);
            }
        });
        enableRefractionBox.setBorder(new EmptyBorder(0, 0, 0, 0));
        enableRefractionBox
                .setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
        enableRefractionBox.setText("Enable:");
        final GridBagConstraints gridBagConstraints_12 = new GridBagConstraints();
        gridBagConstraints_12.gridwidth = 2;
        gridBagConstraints_12.weightx = 1;
        gridBagConstraints_12.anchor = GridBagConstraints.WEST;
        gridBagConstraints_12.gridy = 0;
        gridBagConstraints_12.gridx = 0;
        refractPanel.add(enableRefractionBox, gridBagConstraints_12);

        final JLabel refractionSpeedLabel = new JLabel();
        refractionSpeedLabel.setText("Refraction Speed:");
        final GridBagConstraints gridBagConstraints_14 = new GridBagConstraints();
        gridBagConstraints_14.gridy = 1;
        gridBagConstraints_14.gridx = 0;
        refractPanel.add(refractionSpeedLabel, gridBagConstraints_14);

        refractField = new ValueSpinner(-1000, 1000, .1f);
        refractField.setValue(pass.getSpeedRefraction());
        refractField.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
                pass.setSpeedRefraction(((Number) refractField.getValue())
                        .floatValue());
            }
        });
        final GridBagConstraints gridBagConstraints_16 = new GridBagConstraints();
        gridBagConstraints_16.insets = new Insets(0, 4, 0, 0);
        gridBagConstraints_16.gridy = 1;
        gridBagConstraints_16.gridx = 1;
        refractPanel.add(refractField, gridBagConstraints_16);

        final JPanel wavesPanel = new JPanel();
        wavesPanel.setBorder(new TitledBorder(null, "Waves",
                TitledBorder.DEFAULT_JUSTIFICATION,
                TitledBorder.DEFAULT_POSITION, null, null));
        wavesPanel.setLayout(new GridBagLayout());
        final GridBagConstraints gridBagConstraints_10 = new GridBagConstraints();
        gridBagConstraints_10.gridwidth = 2;
        gridBagConstraints_10.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints_10.gridy = 4;
        gridBagConstraints_10.gridx = 0;
        add(wavesPanel, gridBagConstraints_10);

        enableProjectionCheckBox = new JCheckBox();
        enableProjectionCheckBox.setSelected(pass.isUseProjectedShader());
        enableProjectionCheckBox.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
                Callable<?> exe = new Callable() {
                    public Object call() {
                        try {
                            pass.setUseProjectedShader(enableProjectionCheckBox.isSelected());
                        } catch (Exception ex) {
                            logger.log(Level.SEVERE,
                                    "Water Editor Error Caught", ex);
                        }
                        return null;
                    }
                };
                GameTaskQueueManager.getManager().getQueue(GameTaskQueue.RENDER).enqueue(exe);
            }
        });
        enableProjectionCheckBox.setText("Use Projected");
        final GridBagConstraints gridBagConstraints_28 = new GridBagConstraints();
        gridBagConstraints_28.gridwidth = 2;
        gridBagConstraints_28.gridx = 2;
        gridBagConstraints_28.gridy = 0;
        wavesPanel.add(enableProjectionCheckBox, gridBagConstraints_28);

        final JLabel baseHeightLabel = new JLabel();
        baseHeightLabel.setText("Base Height:");
        final GridBagConstraints gridBagConstraints_17 = new GridBagConstraints();
        gridBagConstraints_17.insets = new Insets(0, 0, 2, 0);
        gridBagConstraints_17.anchor = GridBagConstraints.EAST;
        gridBagConstraints_17.gridy = 1;
        gridBagConstraints_17.gridx = 0;
        wavesPanel.add(baseHeightLabel, gridBagConstraints_17);

        baseHeightField = new ValueSpinner(-10000, 10000, .1f);
        baseHeightField.setValue(pass.getWaterHeight());
        baseHeightField.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
                pass.setWaterHeight(((Number) baseHeightField.getValue())
                        .floatValue());
            }
        });
        final GridBagConstraints gridBagConstraints_18 = new GridBagConstraints();
        gridBagConstraints_18.insets = new Insets(0, 0, 2, 0);
        gridBagConstraints_18.gridy = 1;
        gridBagConstraints_18.gridx = 1;
        wavesPanel.add(baseHeightField, gridBagConstraints_18);

        final JLabel falloffStartLabel = new JLabel();
        falloffStartLabel.setText("Falloff Start:");
        final GridBagConstraints gridBagConstraints_19 = new GridBagConstraints();
        gridBagConstraints_19.insets = new Insets(0, 8, 2, 2);
        gridBagConstraints_19.anchor = GridBagConstraints.EAST;
        gridBagConstraints_19.gridy = 1;
        gridBagConstraints_19.gridx = 2;
        wavesPanel.add(falloffStartLabel, gridBagConstraints_19);

        falloffStartField = new ValueSpinner(-1000, 1000, .1f);
        falloffStartField.setValue(pass.getHeightFalloffStart());
        falloffStartField.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
                pass.setHeightFalloffStart(((Number) falloffStartField
                        .getValue()).floatValue());
            }
        });
        final GridBagConstraints gridBagConstraints_20 = new GridBagConstraints();
        gridBagConstraints_20.insets = new Insets(0, 0, 2, 0);
        gridBagConstraints_20.gridy = 1;
        gridBagConstraints_20.gridx = 3;
        wavesPanel.add(falloffStartField, gridBagConstraints_20);

        final JLabel maxAmplitudeLabel = new JLabel();
        maxAmplitudeLabel.setText("Max Amplitude:");
        final GridBagConstraints gridBagConstraints_21 = new GridBagConstraints();
        gridBagConstraints_21.insets = new Insets(0, 0, 2, 0);
        gridBagConstraints_21.anchor = GridBagConstraints.EAST;
        gridBagConstraints_21.gridy = 2;
        gridBagConstraints_21.gridx = 0;
        wavesPanel.add(maxAmplitudeLabel, gridBagConstraints_21);

        maxAmplitudeField = new ValueSpinner(-1000, 1000, .1f);
        maxAmplitudeField.setValue(pass.getWaterMaxAmplitude());
        maxAmplitudeField.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
                pass.setWaterMaxAmplitude(((Number) maxAmplitudeField
                        .getValue()).floatValue());
            }
        });
        final GridBagConstraints gridBagConstraints_24 = new GridBagConstraints();
        gridBagConstraints_24.insets = new Insets(0, 0, 2, 0);
        gridBagConstraints_24.gridy = 2;
        gridBagConstraints_24.gridx = 1;
        wavesPanel.add(maxAmplitudeField, gridBagConstraints_24);

        final JLabel falloffSpeedLabel = new JLabel();
        falloffSpeedLabel.setText("Falloff Speed:");
        final GridBagConstraints gridBagConstraints_23 = new GridBagConstraints();
        gridBagConstraints_23.insets = new Insets(0, 8, 2, 2);
        gridBagConstraints_23.anchor = GridBagConstraints.EAST;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -