List of usage examples for javax.swing GroupLayout PREFERRED_SIZE
int PREFERRED_SIZE
To view the source code for javax.swing GroupLayout PREFERRED_SIZE.
Click Source Link
From source file:se.llbit.chunky.renderer.ui.RenderControls.java
private JPanel buildSkyPane() { JLabel skyModeLbl = new JLabel("Sky Mode:"); skyModeCB.setModel(new DefaultComboBoxModel(Sky.SkyMode.values())); skyModeCB.addActionListener(skyModeListener); updateSkyMode();//from ww w. jav a 2 s . co m JLabel skymapRotationLbl = new JLabel("Skymap rotation:"); skymapRotationSlider.setMinimum(1); skymapRotationSlider.setMaximum(100); skymapRotationSlider.addChangeListener(skyRotationListener); skymapRotationSlider.setToolTipText("Controls the horizontal rotational offset for the skymap"); JLabel lightProbeRotationLbl = new JLabel("Skymap rotation:"); lightProbeRotationSlider.setMinimum(1); lightProbeRotationSlider.setMaximum(100); lightProbeRotationSlider.addChangeListener(skyRotationListener); lightProbeRotationSlider.setToolTipText("Controls the horizontal rotational offset for the skymap"); JLabel skyboxRotationLbl = new JLabel("Skybox rotation:"); skyboxRotationSlider.setMinimum(1); skyboxRotationSlider.setMaximum(100); skyboxRotationSlider.addChangeListener(skyRotationListener); skyboxRotationSlider.setToolTipText("Controls the horizontal rotational offset for the skymap"); updateSkyRotation(); skyHorizonOffset.update(); cloudSize.update(); cloudXOffset.update(); cloudYOffset.update(); cloudZOffset.update(); JLabel verticalResolutionLbl = new JLabel("Vertical resolution (degrees):"); ButtonGroup verticalResolution = new ButtonGroup(); v90Btn.setSelected(true); v180Btn.setSelected(false); verticalResolution.add(v90Btn); verticalResolution.add(v180Btn); v90Btn.addActionListener(v90Listener); v180Btn.addActionListener(v180Listener); updateVerticalResolution(); simulatedSkyPanel.setBorder(BorderFactory.createTitledBorder("Simulated Sky Settings")); GroupLayout simulatedSkyLayout = new GroupLayout(simulatedSkyPanel); simulatedSkyPanel.setLayout(simulatedSkyLayout); simulatedSkyLayout.setAutoCreateContainerGaps(true); simulatedSkyLayout.setAutoCreateGaps(true); simulatedSkyLayout.setHorizontalGroup(simulatedSkyLayout.createParallelGroup() .addGroup(skyHorizonOffset.horizontalGroup(simulatedSkyLayout))); simulatedSkyLayout.setVerticalGroup(simulatedSkyLayout.createSequentialGroup() .addGroup(skyHorizonOffset.verticalGroup(simulatedSkyLayout))); skymapPanel.setBorder(BorderFactory.createTitledBorder("Skymap Settings")); GroupLayout skymapLayout = new GroupLayout(skymapPanel); skymapPanel.setLayout(skymapLayout); skymapLayout.setAutoCreateContainerGaps(true); skymapLayout.setAutoCreateGaps(true); skymapLayout.setHorizontalGroup(skymapLayout.createParallelGroup().addComponent(loadSkymapBtn) .addGroup(skymapLayout.createSequentialGroup().addComponent(skymapRotationLbl) .addComponent(skymapRotationSlider)) .addGroup(skymapLayout.createSequentialGroup().addComponent(verticalResolutionLbl) .addPreferredGap(ComponentPlacement.RELATED).addComponent(v90Btn) .addPreferredGap(ComponentPlacement.RELATED).addComponent(v180Btn))); skymapLayout.setVerticalGroup(skymapLayout.createSequentialGroup().addComponent(loadSkymapBtn) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(skymapLayout.createParallelGroup(Alignment.BASELINE).addComponent(verticalResolutionLbl) .addComponent(v90Btn).addComponent(v180Btn)) .addPreferredGap(ComponentPlacement.RELATED).addGroup(skymapLayout.createParallelGroup() .addComponent(skymapRotationLbl).addComponent(skymapRotationSlider))); loadSkymapBtn.setText("Load Skymap"); loadSkymapBtn.setToolTipText("Use a panoramic skymap"); loadSkymapBtn.addActionListener(new SkymapTextureLoader(renderMan)); lightProbePanel.setBorder(BorderFactory.createTitledBorder("Spherical Skymap Settings")); GroupLayout lightProbeLayout = new GroupLayout(lightProbePanel); lightProbePanel.setLayout(lightProbeLayout); lightProbeLayout.setAutoCreateContainerGaps(true); lightProbeLayout.setAutoCreateGaps(true); lightProbeLayout.setHorizontalGroup(lightProbeLayout.createParallelGroup().addComponent(loadLightProbeBtn) .addGroup(lightProbeLayout.createSequentialGroup().addComponent(lightProbeRotationLbl) .addComponent(lightProbeRotationSlider))); lightProbeLayout.setVerticalGroup(lightProbeLayout.createSequentialGroup().addComponent(loadLightProbeBtn) .addPreferredGap(ComponentPlacement.RELATED).addGroup(lightProbeLayout.createParallelGroup() .addComponent(lightProbeRotationLbl).addComponent(lightProbeRotationSlider))); loadLightProbeBtn.setText("Load Spherical Skymap"); loadLightProbeBtn.setToolTipText("Select the spherical skymap to use"); loadLightProbeBtn.addActionListener(new SkymapTextureLoader(renderMan)); skyGradientPanel.setBorder(BorderFactory.createTitledBorder("Sky Gradient")); gradientEditor = new GradientEditor(); gradientEditor.addGradientListener(gradientListener); updateSkyGradient(); skyGradientPanel.add(gradientEditor); GroupLayout skyboxLayout = new GroupLayout(skyboxPanel); skyboxPanel.setLayout(skyboxLayout); skyboxPanel.setBorder(BorderFactory.createTitledBorder("Skybox")); JLabel skyboxLbl = new JLabel("Load skybox textures:"); JButton loadUpTexture = new JButton("Up"); loadUpTexture.setToolTipText("Load up texture"); loadUpTexture.setIcon(Icon.skyboxUp.imageIcon()); loadUpTexture.addActionListener(new SkyboxTextureLoader(renderMan, Sky.SKYBOX_UP)); JButton loadDownTexture = new JButton("Down"); loadDownTexture.setToolTipText("Load down texture"); loadDownTexture.setIcon(Icon.skyboxDown.imageIcon()); loadDownTexture.addActionListener(new SkyboxTextureLoader(renderMan, Sky.SKYBOX_DOWN)); JButton loadFrontTexture = new JButton("Front"); loadFrontTexture.setToolTipText("Load front (north) texture"); loadFrontTexture.setIcon(Icon.skyboxFront.imageIcon()); loadFrontTexture.addActionListener(new SkyboxTextureLoader(renderMan, Sky.SKYBOX_FRONT)); JButton loadBackTexture = new JButton("Back"); loadBackTexture.setToolTipText("Load back (south) texture"); loadBackTexture.setIcon(Icon.skyboxBack.imageIcon()); loadBackTexture.addActionListener(new SkyboxTextureLoader(renderMan, Sky.SKYBOX_BACK)); JButton loadRightTexture = new JButton("Right"); loadRightTexture.setToolTipText("Load right (east) texture"); loadRightTexture.setIcon(Icon.skyboxRight.imageIcon()); loadRightTexture.addActionListener(new SkyboxTextureLoader(renderMan, Sky.SKYBOX_RIGHT)); JButton loadLeftTexture = new JButton("Left"); loadLeftTexture.setToolTipText("Load left (west) texture"); loadLeftTexture.setIcon(Icon.skyboxLeft.imageIcon()); loadLeftTexture.addActionListener(new SkyboxTextureLoader(renderMan, Sky.SKYBOX_LEFT)); skyboxLayout.setAutoCreateContainerGaps(true); skyboxLayout.setAutoCreateGaps(true); skyboxLayout.setHorizontalGroup(skyboxLayout.createParallelGroup() .addGroup(skyboxLayout.createSequentialGroup().addComponent(skyboxLbl) .addGroup(skyboxLayout.createParallelGroup().addComponent(loadUpTexture) .addComponent(loadFrontTexture).addComponent(loadRightTexture)) .addGroup(skyboxLayout.createParallelGroup().addComponent(loadDownTexture) .addComponent(loadBackTexture).addComponent(loadLeftTexture))) .addGroup(skyboxLayout.createSequentialGroup().addComponent(skyboxRotationLbl) .addComponent(skyboxRotationSlider))); skyboxLayout.setVerticalGroup(skyboxLayout.createSequentialGroup().addComponent(skyboxLbl) .addGroup(skyboxLayout.createParallelGroup().addComponent(loadUpTexture) .addComponent(loadDownTexture)) .addGroup(skyboxLayout.createParallelGroup().addComponent(loadFrontTexture) .addComponent(loadBackTexture)) .addGroup(skyboxLayout.createParallelGroup().addComponent(loadRightTexture) .addComponent(loadLeftTexture)) .addGroup(skyboxLayout.createParallelGroup().addComponent(skyboxRotationLbl) .addComponent(skyboxRotationSlider))); atmosphereEnabled.setText("enable atmosphere"); atmosphereEnabled.addActionListener(atmosphereListener); updateAtmosphereCheckBox(); transparentSky.setText("transparent sky"); transparentSky.addActionListener(transparentSkyListener); updateTransparentSky(); volumetricFogEnabled.setText("enable volumetric fog"); volumetricFogEnabled.addActionListener(volumetricFogListener); updateVolumetricFogCheckBox(); cloudsEnabled.setText("enable clouds"); cloudsEnabled.addActionListener(cloudsEnabledListener); updateCloudsEnabledCheckBox(); JPanel panel = new JPanel(); GroupLayout layout = new GroupLayout(panel); panel.setLayout(layout); layout.setHorizontalGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup() .addGroup(layout.createSequentialGroup().addComponent(skyModeLbl) .addPreferredGap(ComponentPlacement.RELATED).addComponent(skyModeCB, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)) .addComponent(simulatedSkyPanel).addComponent(skymapPanel).addComponent(lightProbePanel) .addComponent(skyGradientPanel).addComponent(skyboxPanel).addComponent(atmosphereEnabled) .addComponent(transparentSky).addComponent(volumetricFogEnabled).addComponent(cloudsEnabled) .addGroup(cloudSize.horizontalGroup(layout)).addGroup(cloudXOffset.horizontalGroup(layout)) .addGroup(cloudYOffset.horizontalGroup(layout)).addGroup(cloudZOffset.horizontalGroup(layout))) .addContainerGap()); layout.setVerticalGroup(layout.createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(skyModeLbl) .addComponent(skyModeCB)) .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(simulatedSkyPanel) .addComponent(skymapPanel).addComponent(lightProbePanel).addComponent(skyGradientPanel) .addComponent(skyboxPanel).addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(atmosphereEnabled).addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(transparentSky).addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(volumetricFogEnabled).addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(cloudsEnabled).addPreferredGap(ComponentPlacement.RELATED) .addGroup(cloudSize.verticalGroup(layout)).addPreferredGap(ComponentPlacement.RELATED) .addGroup(cloudXOffset.verticalGroup(layout)).addPreferredGap(ComponentPlacement.RELATED) .addGroup(cloudYOffset.verticalGroup(layout)).addPreferredGap(ComponentPlacement.RELATED) .addGroup(cloudZOffset.verticalGroup(layout)).addContainerGap()); return panel; }
From source file:se.llbit.chunky.renderer.ui.RenderControls.java
private JPanel buildCameraPane() { JLabel projectionModeLbl = new JLabel("Projection"); fov.update();//ww w . j a v a 2 s .co m dof = new DoFAdjuster(renderMan); dof.update(); subjectDistance.update(); JLabel presetLbl = new JLabel("Preset:"); CameraPreset[] presets = { CameraPreset.NONE, CameraPreset.ISO_WEST_NORTH, CameraPreset.ISO_NORTH_EAST, CameraPreset.ISO_EAST_SOUTH, CameraPreset.ISO_SOUTH_WEST, CameraPreset.SKYBOX_RIGHT, CameraPreset.SKYBOX_LEFT, CameraPreset.SKYBOX_UP, CameraPreset.SKYBOX_DOWN, CameraPreset.SKYBOX_FRONT, CameraPreset.SKYBOX_BACK, }; cameraPreset.setModel(new DefaultComboBoxModel(presets)); cameraPreset.setMaximumRowCount(presets.length); final int presetHeight = cameraPreset.getPreferredSize().height; final int presetWidth = cameraPreset.getPreferredSize().width; cameraPreset.setRenderer(new DefaultListCellRenderer() { @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); label.setPreferredSize(new Dimension(presetWidth, presetHeight)); CameraPreset preset = (CameraPreset) value; label.setIcon(preset.getIcon()); return label; } }); cameraPreset.addActionListener(cameraPresetListener); JLabel customPresetLbl = new JLabel("Custom preset:"); customPreset.setEditable(true); updateCustomPresets(); JButton savePreset = new JButton("save"); savePreset.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String name = ""; int selected = customPreset.getSelectedIndex(); if (selected == -1) { // select name name = (String) customPreset.getEditor().getItem(); name = (name == null) ? "" : name.trim(); if (name.isEmpty()) { // auto-assign name int nextIndex = customPreset.getItemCount() + 1; outer: while (true) { name = "custom-" + (nextIndex++); for (int i = 0; i < customPreset.getItemCount(); ++i) { String item = (String) customPreset.getItemAt(i); if (name.equals(item)) { continue outer; } } break; } } else { for (int i = 0; i < customPreset.getItemCount(); ++i) { String item = (String) customPreset.getItemAt(i); if (name.equals(item)) { selected = i; break; } } } if (selected == -1) { // add new preset selected = customPreset.getItemCount(); customPreset.addItem(name); } customPreset.setSelectedIndex(selected); } else { name = (String) customPreset.getSelectedItem(); } renderMan.scene().saveCameraPreset(name); } }); JButton loadPreset = new JButton("load"); loadPreset.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String name = ""; int selected = customPreset.getSelectedIndex(); if (selected == -1) { // select name name = (String) customPreset.getEditor().getItem(); name = (name == null) ? "" : name.trim(); } else { name = ((String) customPreset.getSelectedItem()).trim(); } if (!name.isEmpty()) { renderMan.scene().loadCameraPreset(name); } } }); JButton deletePreset = new JButton("delete"); deletePreset.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String name = ""; int selected = customPreset.getSelectedIndex(); if (selected == -1) { // select name name = (String) customPreset.getEditor().getItem(); name = (name == null) ? "" : name.trim(); } else { name = ((String) customPreset.getSelectedItem()).trim(); } if (!name.isEmpty()) { renderMan.scene().deleteCameraPreset(name); if (selected != -1) { customPreset.removeItemAt(selected); } else { for (int i = 0; i < customPreset.getItemCount(); ++i) { if (name.equals(customPreset.getItemAt(i))) { customPreset.removeItemAt(i); break; } } } } } }); ProjectionMode[] projectionModes = ProjectionMode.values(); projectionMode.setModel(new DefaultComboBoxModel(projectionModes)); projectionMode.addActionListener(projectionModeListener); updateProjectionMode(); JButton autoFocusBtn = new JButton("Autofocus"); autoFocusBtn.setToolTipText("Focuses on the object right in the center, under the crosshairs"); autoFocusBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { renderMan.scene().autoFocus(); dof.update(); subjectDistance.update(); } }); JButton cameraToPlayerBtn = new JButton("Camera to player"); cameraToPlayerBtn.setToolTipText("Move camera to player position"); cameraToPlayerBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { renderMan.scene().moveCameraToPlayer(); } }); JLabel posLbl = new JLabel("Position:"); cameraX.setColumns(10); cameraX.setHorizontalAlignment(JTextField.RIGHT); cameraX.addActionListener(cameraPositionListener); cameraY.setColumns(10); cameraY.setHorizontalAlignment(JTextField.RIGHT); cameraY.addActionListener(cameraPositionListener); cameraZ.setColumns(10); cameraZ.setHorizontalAlignment(JTextField.RIGHT); cameraZ.addActionListener(cameraPositionListener); updateCameraPosition(); JLabel dirLbl = new JLabel("Direction:"); cameraYaw.setColumns(10); cameraYaw.setHorizontalAlignment(JTextField.RIGHT); cameraYaw.addActionListener(cameraDirectionListener); cameraPitch.setColumns(10); cameraPitch.setHorizontalAlignment(JTextField.RIGHT); cameraPitch.addActionListener(cameraDirectionListener); cameraRoll.setColumns(10); cameraRoll.setHorizontalAlignment(JTextField.RIGHT); cameraRoll.addActionListener(cameraDirectionListener); updateCameraDirection(); JButton centerCameraBtn = new JButton("Center camera"); centerCameraBtn.setToolTipText("Center camera above loaded chunks"); centerCameraBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { renderMan.scene().moveCameraToCenter(); } }); JSeparator sep1 = new JSeparator(); JPanel panel = new JPanel(); GroupLayout layout = new GroupLayout(panel); panel.setLayout(layout); layout.setHorizontalGroup( layout.createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup().addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup().addComponent(posLbl).addComponent(dirLbl)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup() .addComponent(cameraX, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(cameraYaw, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup() .addComponent(cameraY, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(cameraPitch, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup() .addComponent(cameraZ, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(cameraRoll, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))) .addGroup(layout.createSequentialGroup().addComponent(presetLbl) .addPreferredGap(ComponentPlacement.RELATED).addComponent(cameraPreset)) .addGroup(layout.createSequentialGroup().addComponent(customPresetLbl) .addPreferredGap(ComponentPlacement.RELATED).addComponent(customPreset) .addPreferredGap(ComponentPlacement.RELATED).addComponent(savePreset) .addPreferredGap(ComponentPlacement.RELATED).addComponent(loadPreset) .addPreferredGap(ComponentPlacement.RELATED).addComponent(deletePreset)) .addGroup(layout.createSequentialGroup().addComponent(cameraToPlayerBtn) .addPreferredGap(ComponentPlacement.RELATED).addComponent(centerCameraBtn)) .addComponent(sep1) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup().addComponent(projectionModeLbl) .addComponent(fov.getLabel()).addComponent(dof.getLabel()) .addComponent(subjectDistance.getLabel())) .addGroup(layout.createParallelGroup().addComponent(projectionMode) .addComponent(fov.getSlider()).addComponent(dof.getSlider()) .addComponent(subjectDistance.getSlider())) .addGroup(layout.createParallelGroup().addComponent(fov.getField()) .addComponent(dof.getField()) .addComponent(subjectDistance.getField()))) .addComponent(autoFocusBtn)) .addContainerGap()); layout.setVerticalGroup(layout.createSequentialGroup().addContainerGap() .addGroup(layout .createParallelGroup(Alignment.BASELINE).addComponent(presetLbl).addComponent(cameraPreset)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(customPresetLbl) .addComponent(customPreset).addComponent(savePreset).addComponent(loadPreset) .addComponent(deletePreset)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(posLbl).addComponent(cameraX) .addComponent(cameraY).addComponent(cameraZ)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(dirLbl) .addComponent(cameraYaw).addComponent(cameraPitch).addComponent(cameraRoll)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup( layout.createParallelGroup().addComponent(cameraToPlayerBtn).addComponent(centerCameraBtn)) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent( sep1, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(projectionModeLbl) .addComponent(projectionMode)) .addPreferredGap(ComponentPlacement.RELATED).addGroup(fov.verticalGroup(layout)) .addGroup(dof.verticalGroup(layout)).addGroup(subjectDistance.verticalGroup(layout)) .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(autoFocusBtn).addContainerGap()); return panel; }
From source file:se.llbit.chunky.renderer.ui.tabs.SkyTab.java
public SkyTab(RenderControls renderControls) { super(renderControls); JLabel skyModeLbl = new JLabel("Sky Mode:"); skyModeCB.setModel(new DefaultComboBoxModel(Sky.SkyMode.values())); skyModeCB.addActionListener(skyModeListener); // Need to hide these to not warp the Swing layout: simulatedSkyPanel.setVisible(false); skymapPanel.setVisible(false);//from www .j a v a 2s. co m lightProbePanel.setVisible(false); skyGradientPanel.setVisible(false); skyboxPanel.setVisible(false); JLabel skymapRotationLbl = new JLabel("Skymap rotation:"); skymapRotationSlider.setMinimum(1); skymapRotationSlider.setMaximum(100); skymapRotationSlider.addChangeListener(skyRotationListener); skymapRotationSlider.setToolTipText("Controls the horizontal rotational offset for the skymap"); JLabel lightProbeRotationLbl = new JLabel("Skymap rotation:"); lightProbeRotationSlider.setMinimum(1); lightProbeRotationSlider.setMaximum(100); lightProbeRotationSlider.addChangeListener(skyRotationListener); lightProbeRotationSlider.setToolTipText("Controls the horizontal rotational offset for the skymap"); JLabel skyboxRotationLbl = new JLabel("Skybox rotation:"); skyboxRotationSlider.setMinimum(1); skyboxRotationSlider.setMaximum(100); skyboxRotationSlider.addChangeListener(skyRotationListener); skyboxRotationSlider.setToolTipText("Controls the horizontal rotational offset for the skymap"); JLabel verticalResolutionLbl = new JLabel("Vertical resolution (degrees):"); ButtonGroup verticalResolution = new ButtonGroup(); v90Btn.setSelected(true); v180Btn.setSelected(false); verticalResolution.add(v90Btn); verticalResolution.add(v180Btn); v90Btn.addActionListener(v90Listener); v180Btn.addActionListener(v180Listener); simulatedSkyPanel.setBorder(BorderFactory.createTitledBorder("Simulated Sky Settings")); GroupLayout simulatedSkyLayout = new GroupLayout(simulatedSkyPanel); simulatedSkyPanel.setLayout(simulatedSkyLayout); simulatedSkyLayout.setAutoCreateContainerGaps(true); simulatedSkyLayout.setAutoCreateGaps(true); simulatedSkyLayout.setHorizontalGroup(simulatedSkyLayout.createParallelGroup() .addGroup(skyHorizonOffset.horizontalGroup(simulatedSkyLayout))); simulatedSkyLayout.setVerticalGroup(simulatedSkyLayout.createSequentialGroup() .addGroup(skyHorizonOffset.verticalGroup(simulatedSkyLayout))); skymapPanel.setBorder(BorderFactory.createTitledBorder("Skymap Settings")); GroupLayout skymapLayout = new GroupLayout(skymapPanel); skymapPanel.setLayout(skymapLayout); skymapLayout.setAutoCreateContainerGaps(true); skymapLayout.setAutoCreateGaps(true); skymapLayout.setHorizontalGroup(skymapLayout.createParallelGroup().addComponent(loadSkymapBtn) .addGroup(skymapLayout.createSequentialGroup().addComponent(skymapRotationLbl) .addComponent(skymapRotationSlider)) .addGroup(skymapLayout.createSequentialGroup().addComponent(verticalResolutionLbl) .addPreferredGap(ComponentPlacement.RELATED).addComponent(v90Btn) .addPreferredGap(ComponentPlacement.RELATED).addComponent(v180Btn))); skymapLayout.setVerticalGroup(skymapLayout.createSequentialGroup().addComponent(loadSkymapBtn) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(skymapLayout.createParallelGroup(Alignment.BASELINE).addComponent(verticalResolutionLbl) .addComponent(v90Btn).addComponent(v180Btn)) .addPreferredGap(ComponentPlacement.RELATED).addGroup(skymapLayout.createParallelGroup() .addComponent(skymapRotationLbl).addComponent(skymapRotationSlider))); loadSkymapBtn.setText("Load Skymap"); loadSkymapBtn.setToolTipText("Use a panoramic skymap"); loadSkymapBtn.addActionListener(new SkymapTextureLoader(renderMan)); lightProbePanel.setBorder(BorderFactory.createTitledBorder("Spherical Skymap Settings")); GroupLayout lightProbeLayout = new GroupLayout(lightProbePanel); lightProbePanel.setLayout(lightProbeLayout); lightProbeLayout.setAutoCreateContainerGaps(true); lightProbeLayout.setAutoCreateGaps(true); lightProbeLayout.setHorizontalGroup(lightProbeLayout.createParallelGroup().addComponent(loadLightProbeBtn) .addGroup(lightProbeLayout.createSequentialGroup().addComponent(lightProbeRotationLbl) .addComponent(lightProbeRotationSlider))); lightProbeLayout.setVerticalGroup(lightProbeLayout.createSequentialGroup().addComponent(loadLightProbeBtn) .addPreferredGap(ComponentPlacement.RELATED).addGroup(lightProbeLayout.createParallelGroup() .addComponent(lightProbeRotationLbl).addComponent(lightProbeRotationSlider))); loadLightProbeBtn.setText("Load Spherical Skymap"); loadLightProbeBtn.setToolTipText("Select the spherical skymap to use"); loadLightProbeBtn.addActionListener(new SkymapTextureLoader(renderMan)); skyGradientPanel.setBorder(BorderFactory.createTitledBorder("Sky Gradient")); gradientEditor = new GradientEditor(); gradientEditor.addGradientListener(gradientListener); skyGradientPanel.add(gradientEditor); GroupLayout skyboxLayout = new GroupLayout(skyboxPanel); skyboxPanel.setLayout(skyboxLayout); skyboxPanel.setBorder(BorderFactory.createTitledBorder("Skybox")); JLabel skyboxLbl = new JLabel("Load skybox textures:"); JButton loadUpTexture = new JButton("Up"); loadUpTexture.setToolTipText("Load up texture"); loadUpTexture.setIcon(Icon.skyboxUp.imageIcon()); loadUpTexture.addActionListener(new SkyboxTextureLoader(renderMan, Sky.SKYBOX_UP)); JButton loadDownTexture = new JButton("Down"); loadDownTexture.setToolTipText("Load down texture"); loadDownTexture.setIcon(Icon.skyboxDown.imageIcon()); loadDownTexture.addActionListener(new SkyboxTextureLoader(renderMan, Sky.SKYBOX_DOWN)); JButton loadFrontTexture = new JButton("Front"); loadFrontTexture.setToolTipText("Load front (north) texture"); loadFrontTexture.setIcon(Icon.skyboxFront.imageIcon()); loadFrontTexture.addActionListener(new SkyboxTextureLoader(renderMan, Sky.SKYBOX_FRONT)); JButton loadBackTexture = new JButton("Back"); loadBackTexture.setToolTipText("Load back (south) texture"); loadBackTexture.setIcon(Icon.skyboxBack.imageIcon()); loadBackTexture.addActionListener(new SkyboxTextureLoader(renderMan, Sky.SKYBOX_BACK)); JButton loadRightTexture = new JButton("Right"); loadRightTexture.setToolTipText("Load right (east) texture"); loadRightTexture.setIcon(Icon.skyboxRight.imageIcon()); loadRightTexture.addActionListener(new SkyboxTextureLoader(renderMan, Sky.SKYBOX_RIGHT)); JButton loadLeftTexture = new JButton("Left"); loadLeftTexture.setToolTipText("Load left (west) texture"); loadLeftTexture.setIcon(Icon.skyboxLeft.imageIcon()); loadLeftTexture.addActionListener(new SkyboxTextureLoader(renderMan, Sky.SKYBOX_LEFT)); skyboxLayout.setAutoCreateContainerGaps(true); skyboxLayout.setAutoCreateGaps(true); skyboxLayout.setHorizontalGroup(skyboxLayout.createParallelGroup() .addGroup(skyboxLayout.createSequentialGroup().addComponent(skyboxLbl) .addGroup(skyboxLayout.createParallelGroup().addComponent(loadUpTexture) .addComponent(loadFrontTexture).addComponent(loadRightTexture)) .addGroup(skyboxLayout.createParallelGroup().addComponent(loadDownTexture) .addComponent(loadBackTexture).addComponent(loadLeftTexture))) .addGroup(skyboxLayout.createSequentialGroup().addComponent(skyboxRotationLbl) .addComponent(skyboxRotationSlider))); skyboxLayout.setVerticalGroup(skyboxLayout.createSequentialGroup().addComponent(skyboxLbl) .addGroup(skyboxLayout.createParallelGroup().addComponent(loadUpTexture) .addComponent(loadDownTexture)) .addGroup(skyboxLayout.createParallelGroup().addComponent(loadFrontTexture) .addComponent(loadBackTexture)) .addGroup(skyboxLayout.createParallelGroup().addComponent(loadRightTexture) .addComponent(loadLeftTexture)) .addGroup(skyboxLayout.createParallelGroup().addComponent(skyboxRotationLbl) .addComponent(skyboxRotationSlider))); transparentSky.setText("transparent sky"); transparentSky.setToolTipText("Disables rendering the skybox"); transparentSky.addActionListener(transparentSkyListener); JLabel fogColorLbl = new JLabel( "<html>Hint: set fog density > 0.1 for thick fog,<br>set it < 0.1 for haze/atmosphere effect"); fogColorBtn.setIcon(Icon.colors.imageIcon()); fogColorBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ColorPicker picker = new ColorPicker(fogColorBtn, renderMan.scene().getFogColor()); picker.addColorListener(new ColorListener() { @Override public void onColorPicked(Vector3d color) { renderMan.scene().setFogColor(color); } }); } }); cloudsEnabled.setText("enable clouds"); cloudsEnabled.addActionListener(cloudsEnabledListener); GroupLayout layout = new GroupLayout(this); setLayout(layout); layout.setHorizontalGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup() .addGroup(layout.createSequentialGroup().addComponent(skyModeLbl) .addPreferredGap(ComponentPlacement.RELATED).addComponent(skyModeCB, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)) .addComponent(simulatedSkyPanel).addComponent(skymapPanel).addComponent(lightProbePanel) .addComponent(skyGradientPanel).addComponent(skyboxPanel).addComponent(transparentSky) .addComponent(cloudsEnabled).addGroup(cloudSize.horizontalGroup(layout)) .addGroup(cloudXOffset.horizontalGroup(layout)).addGroup(cloudYOffset.horizontalGroup(layout)) .addGroup(cloudZOffset.horizontalGroup(layout)).addGroup(fogDensity.horizontalGroup(layout)) .addGroup(layout.createSequentialGroup().addComponent(fogColorBtn) .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(fogColorLbl))) .addContainerGap()); layout.setVerticalGroup(layout.createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(skyModeLbl) .addComponent(skyModeCB)) .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(simulatedSkyPanel) .addComponent(skymapPanel).addComponent(lightProbePanel).addComponent(skyGradientPanel) .addComponent(skyboxPanel).addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(transparentSky).addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(cloudsEnabled).addPreferredGap(ComponentPlacement.RELATED) .addGroup(cloudSize.verticalGroup(layout)).addPreferredGap(ComponentPlacement.RELATED) .addGroup(cloudXOffset.verticalGroup(layout)).addPreferredGap(ComponentPlacement.RELATED) .addGroup(cloudYOffset.verticalGroup(layout)).addPreferredGap(ComponentPlacement.RELATED) .addGroup(cloudZOffset.verticalGroup(layout)).addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(fogDensity.verticalGroup(layout)).addPreferredGap(ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup().addComponent(fogColorBtn).addComponent(fogColorLbl)) .addContainerGap()); }
From source file:sk.stuba.fiit.kvasnicka.topologyvisual.gui.simulation.SimulationTopComponent.java
/** * 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.//from w ww. j a v a 2s . com */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { btnAdd = new javax.swing.JButton(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); txtSource = new javax.swing.JTextField(); txtDest = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); txtName = new javax.swing.JTextField(); jScrollPane2 = new javax.swing.JScrollPane(); jXTable1 = new org.jdesktop.swingx.JXTable(); btnAdd.setIcon(new javax.swing.ImageIcon( getClass().getResource("/sk/stuba/fiit/kvasnicka/topologyvisual/resources/files/add.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(btnAdd, org.openide.util.NbBundle .getMessage(SimulationTopComponent.class, "SimulationTopComponent.btnAdd.text")); // NOI18N btnAdd.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnAddActionPerformed(evt); } }); jButton1.setIcon(new javax.swing.ImageIcon( getClass().getResource("/sk/stuba/fiit/kvasnicka/topologyvisual/resources/files/remove.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle .getMessage(SimulationTopComponent.class, "SimulationTopComponent.jButton1.text")); // NOI18N jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setIcon(new javax.swing.ImageIcon( getClass().getResource("/sk/stuba/fiit/kvasnicka/topologyvisual/resources/files/edit.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jButton2, org.openide.util.NbBundle .getMessage(SimulationTopComponent.class, "SimulationTopComponent.jButton2.text")); // NOI18N jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle .getMessage(SimulationTopComponent.class, "SimulationTopComponent.jPanel1.border.title"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle .getMessage(SimulationTopComponent.class, "SimulationTopComponent.jLabel1.text")); // NOI18N txtSource.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { txtSourceKeyReleased(evt); } }); txtDest.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { txtDestKeyReleased(evt); } }); org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle .getMessage(SimulationTopComponent.class, "SimulationTopComponent.jLabel2.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle .getMessage(SimulationTopComponent.class, "SimulationTopComponent.jLabel3.text")); // NOI18N txtName.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { txtNameKeyReleased(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout .setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup().addContainerGap(13, Short.MAX_VALUE) .addComponent(jLabel3).addGap(44, 44, 44) .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(46, 46, 46).addComponent(jLabel1).addGap(44, 44, 44) .addComponent(txtSource, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(46, 46, 46).addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtDest, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(123, 123, 123))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2).addComponent(txtDest, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(txtSource, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3).addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(0, 12, Short.MAX_VALUE))); jXTable1.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { }, new String[] { "ID", "Name", "Source", "Destination", "Ping" }) { Class[] types = new Class[] { java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Boolean.class }; boolean[] canEdit = new boolean[] { false, false, false, false, false }; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); jXTable1.setColumnSelectionAllowed(true); jXTable1.setSortable(false); jXTable1.getTableHeader().setReorderingAllowed(false); jScrollPane2.setViewportView(jXTable1); jXTable1.getColumnModel().getSelectionModel() .setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); jXTable1.getColumnModel().getColumn(0).setResizable(false); jXTable1.getColumnModel().getColumn(0).setHeaderValue(org.openide.util.NbBundle .getMessage(SimulationTopComponent.class, "SimulationTopComponent.jXTable1.columnModel.title2")); // NOI18N jXTable1.getColumnModel().getColumn(1).setHeaderValue(org.openide.util.NbBundle .getMessage(SimulationTopComponent.class, "SimulationTopComponent.jXTable1.columnModel.title4")); // NOI18N jXTable1.getColumnModel().getColumn(2).setHeaderValue(org.openide.util.NbBundle .getMessage(SimulationTopComponent.class, "SimulationTopComponent.jXTable1.columnModel.title0")); // NOI18N jXTable1.getColumnModel().getColumn(3).setHeaderValue(org.openide.util.NbBundle .getMessage(SimulationTopComponent.class, "SimulationTopComponent.jXTable1.columnModel.title1")); // NOI18N jXTable1.getColumnModel().getColumn(4).setMinWidth(50); jXTable1.getColumnModel().getColumn(4).setPreferredWidth(70); jXTable1.getColumnModel().getColumn(4).setMaxWidth(100); jXTable1.getColumnModel().getColumn(4).setHeaderValue(org.openide.util.NbBundle .getMessage(SimulationTopComponent.class, "SimulationTopComponent.jXTable1.columnModel.title3")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 643, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnAdd, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addContainerGap(21, Short.MAX_VALUE))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup().addGap(34, 34, 34).addComponent(btnAdd) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton2).addGap(0, 96, Short.MAX_VALUE))) .addGap(38, 38, 38) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); }
From source file:Store.HealthSMS.java
/** * 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./* w ww .java2 s .co m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jToolBar1 = new javax.swing.JToolBar(); jButton2 = new javax.swing.JButton(); jButton1 = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); txt_msg = new javax.swing.JTextArea(); jLabel2 = new javax.swing.JLabel(); Send = new javax.swing.JButton(); clr = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); spno = new javax.swing.JTextField(); txt_no = new javax.swing.JTextField(); src_btn = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); hdate = new javax.swing.JMenu(); htime = new javax.swing.JMenu(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("SEND SMS TO PATIENTS"); setBackground(new java.awt.Color(0, 153, 51)); setFont(new java.awt.Font("Agency FB", 1, 10)); // NOI18N setResizable(false); jToolBar1.setRollover(true); jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Store/icons/lightbox-prev.png"))); // NOI18N jButton2.setToolTipText("Back"); jButton2.setFocusable(false); jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jToolBar1.add(jButton2); jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Store/icons/logout-icon_small.png"))); // NOI18N jButton1.setToolTipText("Log Out"); jButton1.setFocusable(false); jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jToolBar1.add(jButton1); txt_msg.setColumns(20); txt_msg.setRows(5); txt_msg.setText("Type The Message..."); txt_msg.setToolTipText("Type The Message..."); txt_msg.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { txt_msgMouseClicked(evt); } }); jScrollPane1.setViewportView(txt_msg); jLabel2.setText("Message"); Send.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Store/icons/messages-icon2.png"))); // NOI18N Send.setText("Send"); Send.setToolTipText("Send SMS to Patients"); Send.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { SendActionPerformed(evt); } }); clr.setText("Clear"); clr.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clrActionPerformed(evt); } }); jLabel1.setText("Phone Number"); spno.setEditable(false); spno.setToolTipText("Enter The Phone Number,start +254..."); spno.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { spnoMouseClicked(evt); } }); spno.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { spnoKeyTyped(evt); } }); txt_no.setText("Enter Patient's Admittion Number to Search"); src_btn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Store/icons/search-icon.png"))); // NOI18N src_btn.setText("Search"); src_btn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { src_btnActionPerformed(evt); } }); jMenu1.setText("File"); jMenu1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenu1ActionPerformed(evt); } }); jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Store/icons/logout-icon_small.png"))); // NOI18N jMenuItem1.setText("Log Out"); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); jMenu1.add(jMenuItem1); jMenuBar1.add(jMenu1); hdate.setText("Date"); jMenuBar1.add(hdate); htime.setText("Time"); jMenuBar1.add(htime); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout.createSequentialGroup().addGap(115, 115, 115).addComponent(jLabel1)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 497, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup().addGap(35, 35, 35).addComponent( jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 207, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(txt_no, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(spno, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE)) .addGap(30, 30, 30).addComponent(src_btn)))) .addGroup(layout.createSequentialGroup().addGap(272, 272, 272).addComponent(Send) .addGap(43, 43, 43).addComponent(clr))) .addContainerGap(154, Short.MAX_VALUE))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap() .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 106, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(src_btn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(txt_no, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(spno, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32) .addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 232, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(clr, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Send))) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18))); setSize(new java.awt.Dimension(870, 630)); setLocationRelativeTo(null); }
From source file:Store.SendToDocs.java
/** * 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./*w w w . ja va2 s . co m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jToolBar1 = new javax.swing.JToolBar(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); d_no = new javax.swing.JTextField(); jScrollPane1 = new javax.swing.JScrollPane(); d_txt = new javax.swing.JTextArea(); dsend = new javax.swing.JButton(); dclr = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); txt_dssrc = new javax.swing.JTextField(); dsrc = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); sdate = new javax.swing.JMenu(); stime = new javax.swing.JMenu(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setResizable(false); jToolBar1.setRollover(true); jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Store/icons/lightbox-prev.png"))); // NOI18N jButton1.setToolTipText("Back"); jButton1.setFocusable(false); jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jToolBar1.add(jButton1); jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Store/icons/logout-icon_small.png"))); // NOI18N jButton2.setToolTipText("LOg Out"); jButton2.setFocusable(false); jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jToolBar1.add(jButton2); jLabel1.setText("Message"); d_no.setEditable(false); d_no.setToolTipText("Enter Phone Number,Start +254..."); d_no.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { d_noMouseClicked(evt); } }); d_no.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { d_noKeyTyped(evt); } }); d_txt.setColumns(20); d_txt.setRows(5); d_txt.setText("Type Your Message..."); d_txt.setToolTipText("Enter Phone Number,Start +254.."); d_txt.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { d_txtMouseClicked(evt); } }); jScrollPane1.setViewportView(d_txt); dsend.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Store/icons/messages-icon2.png"))); // NOI18N dsend.setText("Send"); dsend.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { dsendActionPerformed(evt); } }); dclr.setText("Clear"); dclr.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { dclrActionPerformed(evt); } }); jLabel2.setText("Phone Number"); txt_dssrc.setText("Enter Doctor's Number To Search"); dsrc.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Store/icons/search-icon.png"))); // NOI18N dsrc.setText("Search"); dsrc.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { dsrcActionPerformed(evt); } }); jMenu1.setText("File"); jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Store/icons/logout-icon_small.png"))); // NOI18N jMenuItem1.setText("Log Out"); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); jMenu1.add(jMenuItem1); jMenuBar1.add(jMenu1); sdate.setText("Date"); jMenuBar1.add(sdate); stime.setText("Time"); jMenuBar1.add(stime); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(195, 195, 195) .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup().addGap(325, 325, 325).addComponent(dsend) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(dclr)) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(135, 135, 135) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18)) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap() .addComponent(jLabel2).addGap(32, 32, 32))) .addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(txt_dssrc, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(d_no, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)) .addGap(40, 40, 40).addComponent(dsrc)) .addComponent(jScrollPane1)))) .addContainerGap(186, Short.MAX_VALUE))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 25, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(dsrc, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(txt_dssrc)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(d_no, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2)) .addGap(27, 27, 27) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(dsend).addComponent(dclr)) .addGap(69, 69, 69))); setSize(new java.awt.Dimension(829, 535)); setLocationRelativeTo(null); }
From source file:thesaurusEditor.gui.graph.MainGraph.java
/** * create an instance of a simple graph with basic controls *//* w ww . ja v a 2 s .c om*/ public MainGraph(List<Konzept> konzepte, Main main) { // create a simple graph for the demo this.konzepte = konzepte; this.main = main; main.getController().getThesaurus().addObserver(this); graph = new DirectedSparseGraph<Konzept, EdgeClass>(); for (Konzept k : konzepte) { graph.addVertex(k); } createEdges(konzepte); layout = new PersistentLayoutImpl<Konzept, EdgeClass>(new FRLayout<Konzept, EdgeClass>(graph)); //layout = new FRLayout<Konzept,EdgeClass>(graph); Dimension preferredSize = new Dimension(1300, 900); final VisualizationModel<Konzept, EdgeClass> visualizationModel = new DefaultVisualizationModel<Konzept, EdgeClass>( layout, preferredSize); vv = new VisualizationViewer<Konzept, EdgeClass>(visualizationModel, preferredSize); // this class will provide both label drawing and vertex shapes VertexLabelAsShapeRenderer<Konzept, EdgeClass> vlasr = new VertexLabelAsShapeRenderer<Konzept, EdgeClass>( vv.getRenderContext()); // customize the render context vv.getRenderContext().setVertexLabelTransformer(new Transformer<Konzept, String>() { public String transform(Konzept k) { return ""; } }); // this chains together Transformers so that the html tags // are prepended to the toString method output /*new ChainedTransformer<Konzept,String>(new Transformer[]{ new ToStringLabeller<Konzept>(), new Transformer<Konzept,String>() { public String transform(Konzept input) { return input.toString(); }}}));*/ vv.getRenderContext().setVertexShapeTransformer(new Transformer<Konzept, Shape>() { public Shape transform(Konzept k) { return new Rectangle(-((k.toString().length() * 8 + 10) / 2), -(10), k.toString().length() * 7 + 18, 21); } }); vv.getRenderContext().setVertexLabelRenderer(new DefaultVertexLabelRenderer(Color.red)); vv.getRenderContext().setEdgeDrawPaintTransformer(new ConstantTransformer(Color.black)); vv.getRenderContext().setEdgeStrokeTransformer(new ConstantTransformer(new BasicStroke(2.5f))); vv.getRenderContext().setVertexFillPaintTransformer( new PickableVertexPaintTransformer<Konzept>(vv.getPickedVertexState(), Color.white, Color.yellow)); vv.getRenderContext().setEdgeDrawPaintTransformer( new PickableEdgePaintTransformer<EdgeClass>(vv.getPickedEdgeState(), Color.black, Color.red)); vv.getRenderContext().setVertexIconTransformer(new Transformer<Konzept, Icon>() { /* * Implements the Icon interface to draw an Icon with background color and * a text label */ public Icon transform(final Konzept v) { return new Icon() { private Konzept k; public int getIconHeight() { return 20; } public int getIconWidth() { if (k != null) { return k.toString().length() * 7 + 10; } return v.toString().length() * 7 + 10; } public void paintIcon(Component c, Graphics g, int x, int y) { if (vv.getPickedVertexState().isPicked(v)) { g.setColor(Color.yellow); } else { g.setColor(Color.lightGray); } g.fillRect(x, y, v.toString().length() * 8 + 10, 20); if (vv.getPickedVertexState().isPicked(v)) { g.setColor(Color.black); } else { g.setColor(Color.black); } g.drawRect(x, y, v.toString().length() * 8 + 10, 20); if (vv.getPickedVertexState().isPicked(v)) { g.setColor(Color.black); } else { g.setColor(Color.black); } this.k = v; if (vv.getPickedVertexState().isPicked(v)) { Font font = new Font("DejaVu Sans Mono", Font.BOLD, 14); g.setFont(font); g.drawString("" + v, x + 6, y + 15); } else { Font font = new Font("DejaVu Sans Mono", Font.PLAIN, 14); g.setFont(font); g.drawString("" + v, x + 6, y + 15); } this.k = v; } }; } }); // customize the renderer /*GradientVertexRenderer<Konzept,EdgeClass> vertex = new GradientVertexRenderer<Konzept,EdgeClass>(Color.white, Color.white, true); vv.getRenderer().setVertexRenderer(vertex); vv.getRenderer().setVertexLabelRenderer(vlasr); */ vv.setBackground(Color.white); // add a listener for ToolTips KonzeptParser<Konzept> parser = new KonzeptParser<Konzept>(); vv.setVertexToolTipTransformer(parser); /*final DefaultModalGraphMouse<Konzept,Edge> graphMouse = new DefaultModalGraphMouse<Konzept,Edge>(); */ Factory<Konzept> vertexFactory = new VertexFactory(); Factory<EdgeClass> edgeFactory = new EdgeFactory(); graphMouse = new MyModalGraphMouse<Konzept, EdgeClass>(vv.getRenderContext(), vertexFactory, edgeFactory, main, vv); vv.setGraphMouse(graphMouse); vv.addKeyListener(graphMouse.getModeKeyListener()); // the EditingGraphMouse will pass mouse event coordinates to the // vertexLocations function to set the locations of the vertices as // they are created // graphMouse.setVertexLocations(vertexLocations); vv.setGraphMouse(graphMouse); vv.addKeyListener(graphMouse.getModeKeyListener()); graphMouse.setMode(ModalGraphMouse.Mode.EDITING); GraphZoomScrollPane gzsp = new GraphZoomScrollPane(vv); JComboBox modeBox = graphMouse.getModeComboBox(); modeBox.addItemListener(graphMouse.getModeListener()); //graphMouse.setMode(ModalGraphMouse.Mode.TRANSFORMING); final ScalingControl scaler = new CrossoverScalingControl(); JButton plus = new JButton(); plus.setIcon(new ImageIcon(getClass().getResource("/thesaurusEditor/img/zoom_in.png"))); plus.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { scaler.scale(vv, 1.1f, vv.getCenter()); } }); JButton minus = new JButton(); minus.setIcon(new ImageIcon(getClass().getResource("/thesaurusEditor/img/zoom_out.png"))); minus.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { scaler.scale(vv, 1 / 1.1f, vv.getCenter()); } }); JPanel controls = new JPanel(); JPanel zoomControls = new JPanel(new GridLayout(1, 2)); //zoomControls.setBorder(BorderFactory.createTitledBorder("Zoom")); zoomControls.add(plus); zoomControls.add(minus); controls.add(zoomControls); //controls.add(modeBox); /* javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(gzsp); gzsp.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 374, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 106, Short.MAX_VALUE) ); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(controls); controls.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 374, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 164, Short.MAX_VALUE) );*/ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(gzsp, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(controls, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap() .addComponent(gzsp, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(controls, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); }
From source file:tubessister.KonsesusPaxos.java
/** * 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./*from w ww . jav a 2 s .co m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLayeredPane1 = new javax.swing.JLayeredPane(); MenuAwal = new javax.swing.JPanel(); PlayGameButton = new javax.swing.JLabel(); LogoGame = new javax.swing.JLabel(); GamePlaySiang = new javax.swing.JPanel(); PlayGameButton1 = new javax.swing.JLabel(); username = new javax.swing.JLabel(); ServerAddress7 = new javax.swing.JLabel(); playrole = new javax.swing.JLabel(); username1 = new javax.swing.JLabel(); username2 = new javax.swing.JLabel(); LogoGame1 = new javax.swing.JLabel(); jComboBox1 = new javax.swing.JComboBox<>(); ServerAddress8 = new javax.swing.JLabel(); jButton3 = new javax.swing.JButton(); Register = new javax.swing.JPanel(); ServerAddress1 = new javax.swing.JLabel(); ServerAddress = new javax.swing.JLabel(); InsertServerAddress = new javax.swing.JTextField(); Port = new javax.swing.JLabel(); InsertPort = new javax.swing.JTextField(); Port1 = new javax.swing.JLabel(); InsertNickname = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); GagalLogin1 = new javax.swing.JPanel(); LoginFailedPanel1 = new javax.swing.JPanel(); LoginFailed1 = new javax.swing.JLabel(); LoginFailedButton1 = new javax.swing.JButton(); LoginFailed4 = new javax.swing.JLabel(); GagalLogin2 = new javax.swing.JPanel(); LoginFailedPanel2 = new javax.swing.JPanel(); LoginFailed2 = new javax.swing.JLabel(); LoginFailedButton2 = new javax.swing.JButton(); LoginFailed3 = new javax.swing.JLabel(); GamePlayMalam = new javax.swing.JPanel(); PlayGameButton2 = new javax.swing.JLabel(); ServerAddress3 = new javax.swing.JLabel(); StatusReady = new javax.swing.JPanel(); ServerAddress4 = new javax.swing.JLabel(); ServerAddress5 = new javax.swing.JLabel(); ServerID = new javax.swing.JLabel(); Port2 = new javax.swing.JLabel(); PortID = new javax.swing.JLabel(); Port3 = new javax.swing.JLabel(); NicknameID = new javax.swing.JLabel(); jButton2 = new javax.swing.JButton(); Status = new javax.swing.JLabel(); StartGame = new javax.swing.JPanel(); PlayGameButton3 = new javax.swing.JLabel(); ServerAddress6 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLayeredPane1.setLayout(new javax.swing.OverlayLayout(jLayeredPane1)); MenuAwal.setBackground(new java.awt.Color(153, 204, 255)); MenuAwal.setMinimumSize(new java.awt.Dimension(960, 560)); PlayGameButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/tubessister/playbutton.png"))); // NOI18N PlayGameButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { PlayGameButtonMousePressed(evt); } }); LogoGame.setIcon(new javax.swing.ImageIcon(getClass().getResource("/tubessister/LogoGame.png"))); // NOI18N javax.swing.GroupLayout MenuAwalLayout = new javax.swing.GroupLayout(MenuAwal); MenuAwal.setLayout(MenuAwalLayout); MenuAwalLayout.setHorizontalGroup(MenuAwalLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MenuAwalLayout.createSequentialGroup().addContainerGap(405, Short.MAX_VALUE) .addGroup(MenuAwalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, MenuAwalLayout.createSequentialGroup().addComponent(LogoGame).addGap(339, 339, 339)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, MenuAwalLayout.createSequentialGroup().addComponent(PlayGameButton) .addGap(412, 412, 412))))); MenuAwalLayout.setVerticalGroup(MenuAwalLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(MenuAwalLayout.createSequentialGroup().addGap(48, 48, 48).addComponent(LogoGame) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 209, Short.MAX_VALUE) .addComponent(PlayGameButton).addGap(89, 89, 89))); jLayeredPane1.add(MenuAwal); GamePlaySiang.setBackground(new java.awt.Color(153, 204, 255)); PlayGameButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/tubessister/sun (2).png"))); // NOI18N PlayGameButton1.setMaximumSize(new java.awt.Dimension(230, 230)); PlayGameButton1.setMinimumSize(new java.awt.Dimension(230, 230)); PlayGameButton1.setPreferredSize(new java.awt.Dimension(230, 239)); username.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N username.setText("username"); ServerAddress7.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N ServerAddress7.setText("Siang Hari"); playrole.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N playrole.setText("playrole"); username1.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N username1.setText("username"); username2.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N username2.setText("username"); LogoGame1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/tubessister/LogoGame.png"))); // NOI18N jComboBox1.setModel( new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); ServerAddress8.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N ServerAddress8.setText("Player to Kill"); jButton3.setText("Vote"); jButton3.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton3MousePressed(evt); } }); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); javax.swing.GroupLayout GamePlaySiangLayout = new javax.swing.GroupLayout(GamePlaySiang); GamePlaySiang.setLayout(GamePlaySiangLayout); GamePlaySiangLayout.setHorizontalGroup(GamePlaySiangLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, GamePlaySiangLayout.createSequentialGroup().addGap(0, 749, Short.MAX_VALUE).addComponent( LogoGame1, javax.swing.GroupLayout.PREFERRED_SIZE, 416, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(GamePlaySiangLayout.createSequentialGroup().addGroup(GamePlaySiangLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(GamePlaySiangLayout.createSequentialGroup().addGap(31, 31, 31) .addComponent(PlayGameButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(GamePlaySiangLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(GamePlaySiangLayout.createSequentialGroup() .addComponent(ServerAddress8).addGap(92, 92, 92) .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(ServerAddress7))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, GamePlaySiangLayout.createSequentialGroup().addGap(306, 306, 306).addComponent( jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(GamePlaySiangLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(username).addComponent(username1)) .addGap(168, 168, 168) .addGroup(GamePlaySiangLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(playrole).addComponent(username2)) .addGap(53, 53, 53))); GamePlaySiangLayout.setVerticalGroup(GamePlaySiangLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(GamePlaySiangLayout.createSequentialGroup() .addGroup(GamePlaySiangLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(GamePlaySiangLayout.createSequentialGroup().addGap(33, 33, 33) .addComponent(PlayGameButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(GamePlaySiangLayout.createSequentialGroup().addGap(47, 47, 47) .addGroup(GamePlaySiangLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ServerAddress7).addComponent(playrole) .addComponent(username)))) .addGap(67, 67, 67) .addGroup(GamePlaySiangLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(username1).addComponent(username2) .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ServerAddress8)) .addGap(47, 47, 47) .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 197, Short.MAX_VALUE) .addComponent(LogoGame1))); jLayeredPane1.add(GamePlaySiang); Register.setBackground(new java.awt.Color(153, 204, 255)); ServerAddress1.setFont(new java.awt.Font("Verdana", 0, 48)); // NOI18N ServerAddress1.setText("Register"); ServerAddress.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N ServerAddress.setText("Server:"); InsertServerAddress.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 0, 18)); // NOI18N InsertServerAddress.setHorizontalAlignment(javax.swing.JTextField.LEFT); InsertServerAddress.setToolTipText(""); InsertServerAddress.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { InsertServerAddressActionPerformed(evt); } }); Port.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N Port.setText("Port:"); InsertPort.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 0, 18)); // NOI18N InsertPort.setHorizontalAlignment(javax.swing.JTextField.LEFT); InsertPort.setToolTipText(""); Port1.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N Port1.setText("Nickname:"); InsertNickname.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 0, 18)); // NOI18N InsertNickname.setHorizontalAlignment(javax.swing.JTextField.LEFT); InsertNickname.setToolTipText(""); InsertNickname.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { InsertNicknameActionPerformed(evt); } }); jButton1.setText("Join Game"); jButton1.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton1MousePressed(evt); } }); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); javax.swing.GroupLayout RegisterLayout = new javax.swing.GroupLayout(Register); Register.setLayout(RegisterLayout); RegisterLayout.setHorizontalGroup(RegisterLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, RegisterLayout.createSequentialGroup() .addContainerGap(423, Short.MAX_VALUE) .addGroup(RegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, RegisterLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(InsertNickname, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(RegisterLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(RegisterLayout.createSequentialGroup().addComponent(Port1) .addGap(229, 229, 229)) .addGroup(RegisterLayout.createSequentialGroup() .addGroup(RegisterLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ServerAddress).addComponent(Port)) .addGap(88, 88, 88) .addGroup(RegisterLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(InsertServerAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(InsertPort, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))))) .addGroup(RegisterLayout.createSequentialGroup().addGroup(RegisterLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(RegisterLayout.createSequentialGroup().addGap(73, 73, 73) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(RegisterLayout.createSequentialGroup().addGap(39, 39, 39) .addComponent(ServerAddress1))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 57, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(418, 418, 418))); RegisterLayout.setVerticalGroup(RegisterLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(RegisterLayout.createSequentialGroup().addGap(92, 92, 92).addComponent(ServerAddress1) .addGap(40, 40, 40) .addGroup(RegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(InsertServerAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ServerAddress)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE) .addGroup(RegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(InsertPort, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Port)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 17, Short.MAX_VALUE) .addGroup(RegisterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(InsertNickname, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Port1)) .addGap(38, 38, 38).addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(238, 238, 238))); jLayeredPane1.add(Register); GagalLogin1.setBackground(new java.awt.Color(153, 204, 255)); GagalLogin1.setForeground(new java.awt.Color(153, 204, 255)); GagalLogin1.setMinimumSize(new java.awt.Dimension(960, 560)); GagalLogin1.setOpaque(false); LoginFailedPanel1.setBackground(new java.awt.Color(204, 255, 255)); LoginFailed1.setFont(new java.awt.Font("Prestige Elite Std", 1, 18)); // NOI18N LoginFailed1.setText("Gagal Register :"); LoginFailedButton1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N LoginFailedButton1.setText("OK"); LoginFailedButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { LoginFailedButton1ActionPerformed(evt); } }); LoginFailed4.setFont(new java.awt.Font("Prestige Elite Std", 1, 18)); // NOI18N LoginFailed4.setText("IP Address atau Port Salah"); javax.swing.GroupLayout LoginFailedPanel1Layout = new javax.swing.GroupLayout(LoginFailedPanel1); LoginFailedPanel1.setLayout(LoginFailedPanel1Layout); LoginFailedPanel1Layout.setHorizontalGroup( LoginFailedPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, LoginFailedPanel1Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(LoginFailedButton1).addGap(48, 48, 48)) .addGroup(LoginFailedPanel1Layout.createSequentialGroup() .addGroup(LoginFailedPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(LoginFailedPanel1Layout.createSequentialGroup() .addGap(166, 166, 166).addComponent(LoginFailed1)) .addGroup(LoginFailedPanel1Layout.createSequentialGroup() .addGap(122, 122, 122).addComponent(LoginFailed4))) .addContainerGap(139, Short.MAX_VALUE))); LoginFailedPanel1Layout.setVerticalGroup(LoginFailedPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(LoginFailedPanel1Layout.createSequentialGroup().addContainerGap(58, Short.MAX_VALUE) .addComponent(LoginFailed1).addGap(37, 37, 37).addComponent(LoginFailed4).addGap(37, 37, 37) .addComponent(LoginFailedButton1).addGap(27, 27, 27))); javax.swing.GroupLayout GagalLogin1Layout = new javax.swing.GroupLayout(GagalLogin1); GagalLogin1.setLayout(GagalLogin1Layout); GagalLogin1Layout.setHorizontalGroup(GagalLogin1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(GagalLogin1Layout.createSequentialGroup().addGap(302, 302, 302) .addComponent(LoginFailedPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(341, Short.MAX_VALUE))); GagalLogin1Layout.setVerticalGroup(GagalLogin1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, GagalLogin1Layout.createSequentialGroup() .addContainerGap(228, Short.MAX_VALUE) .addComponent(LoginFailedPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(191, 191, 191))); jLayeredPane1.add(GagalLogin1); GagalLogin2.setMinimumSize(new java.awt.Dimension(960, 560)); GagalLogin2.setOpaque(false); LoginFailedPanel2.setBackground(new java.awt.Color(204, 255, 255)); LoginFailed2.setFont(new java.awt.Font("Prestige Elite Std", 1, 18)); // NOI18N LoginFailed2.setText("Gagal Register: "); LoginFailedButton2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N LoginFailedButton2.setText("OK"); LoginFailedButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { LoginFailedButton2ActionPerformed(evt); } }); LoginFailed3.setFont(new java.awt.Font("Prestige Elite Std", 1, 18)); // NOI18N LoginFailed3.setText("Nickname Sudah Digunakan"); javax.swing.GroupLayout LoginFailedPanel2Layout = new javax.swing.GroupLayout(LoginFailedPanel2); LoginFailedPanel2.setLayout(LoginFailedPanel2Layout); LoginFailedPanel2Layout.setHorizontalGroup( LoginFailedPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(LoginFailedPanel2Layout.createSequentialGroup().addGap(152, 152, 152) .addComponent(LoginFailed2).addGap(0, 0, Short.MAX_VALUE)) .addGroup(LoginFailedPanel2Layout.createSequentialGroup().addGap(94, 94, 94) .addComponent(LoginFailed3).addContainerGap(116, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, LoginFailedPanel2Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(LoginFailedButton2).addGap(47, 47, 47))); LoginFailedPanel2Layout.setVerticalGroup( LoginFailedPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(LoginFailedPanel2Layout.createSequentialGroup() .addContainerGap(69, Short.MAX_VALUE).addComponent(LoginFailed2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(LoginFailed3).addGap(60, 60, 60).addComponent(LoginFailedButton2) .addContainerGap())); javax.swing.GroupLayout GagalLogin2Layout = new javax.swing.GroupLayout(GagalLogin2); GagalLogin2.setLayout(GagalLogin2Layout); GagalLogin2Layout.setHorizontalGroup(GagalLogin2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(GagalLogin2Layout.createSequentialGroup().addGap(339, 339, 339) .addComponent(LoginFailedPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(342, Short.MAX_VALUE))); GagalLogin2Layout.setVerticalGroup(GagalLogin2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, GagalLogin2Layout.createSequentialGroup() .addContainerGap(221, Short.MAX_VALUE) .addComponent(LoginFailedPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(206, 206, 206))); jLayeredPane1.add(GagalLogin2); GamePlayMalam.setBackground(new java.awt.Color(153, 204, 255)); PlayGameButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/tubessister/moon (1).png"))); // NOI18N PlayGameButton2.setMaximumSize(new java.awt.Dimension(230, 230)); PlayGameButton2.setMinimumSize(new java.awt.Dimension(230, 230)); PlayGameButton2.setPreferredSize(new java.awt.Dimension(230, 239)); ServerAddress3.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N ServerAddress3.setText("Malam Hari"); javax.swing.GroupLayout GamePlayMalamLayout = new javax.swing.GroupLayout(GamePlayMalam); GamePlayMalam.setLayout(GamePlayMalamLayout); GamePlayMalamLayout.setHorizontalGroup( GamePlayMalamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(GamePlayMalamLayout.createSequentialGroup().addGap(31, 31, 31) .addComponent(PlayGameButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(ServerAddress3) .addContainerGap(980, Short.MAX_VALUE))); GamePlayMalamLayout.setVerticalGroup(GamePlayMalamLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(GamePlayMalamLayout.createSequentialGroup() .addGroup(GamePlayMalamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(GamePlayMalamLayout.createSequentialGroup().addGap(33, 33, 33) .addComponent(PlayGameButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(GamePlayMalamLayout.createSequentialGroup().addGap(47, 47, 47) .addComponent(ServerAddress3))) .addContainerGap(571, Short.MAX_VALUE))); jLayeredPane1.add(GamePlayMalam); StatusReady.setBackground(new java.awt.Color(153, 204, 255)); ServerAddress4.setFont(new java.awt.Font("Verdana", 0, 48)); // NOI18N ServerAddress4.setText("Register Succesfully With"); ServerAddress5.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N ServerAddress5.setText("Server:"); ServerID.setFont(new java.awt.Font("Tempus Sans ITC", 0, 24)); // NOI18N ServerID.setText("server"); Port2.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N Port2.setText("Port:"); PortID.setFont(new java.awt.Font("Tempus Sans ITC", 0, 24)); // NOI18N PortID.setText("port"); Port3.setFont(new java.awt.Font("Verdana", 0, 12)); // NOI18N Port3.setText("Nickname:"); NicknameID.setFont(new java.awt.Font("Tempus Sans ITC", 0, 24)); // NOI18N NicknameID.setText("nickname"); jButton2.setText("Ready Game to Start"); jButton2.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton2MousePressed(evt); } }); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); Status.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N Status.setText("After you click ready game, wait until 6 player ready to play the game"); javax.swing.GroupLayout StatusReadyLayout = new javax.swing.GroupLayout(StatusReady); StatusReady.setLayout(StatusReadyLayout); StatusReadyLayout.setHorizontalGroup(StatusReadyLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(StatusReadyLayout.createSequentialGroup().addGroup(StatusReadyLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(StatusReadyLayout.createSequentialGroup().addGap(454, 454, 454).addComponent( jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(StatusReadyLayout.createSequentialGroup().addGap(420, 420, 420) .addGroup(StatusReadyLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ServerAddress5).addComponent(Port2).addComponent(Port3)) .addGap(69, 69, 69) .addGroup(StatusReadyLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ServerID).addComponent(PortID).addComponent(NicknameID))) .addGroup(StatusReadyLayout.createSequentialGroup().addGap(241, 241, 241) .addComponent(ServerAddress4)) .addGroup(StatusReadyLayout.createSequentialGroup().addGap(314, 314, 314) .addComponent(Status))) .addContainerGap(285, Short.MAX_VALUE))); StatusReadyLayout.setVerticalGroup(StatusReadyLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(StatusReadyLayout.createSequentialGroup().addGap(186, 186, 186) .addComponent(ServerAddress4).addGap(34, 34, 34) .addGroup(StatusReadyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ServerAddress5).addComponent(ServerID)) .addGap(18, 18, 18) .addGroup(StatusReadyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(Port2).addComponent(PortID)) .addGap(18, 18, 18) .addGroup(StatusReadyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(NicknameID).addComponent(Port3)) .addGap(18, 18, 18) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(34, 34, 34).addComponent(Status).addContainerGap(150, Short.MAX_VALUE))); jLayeredPane1.add(StatusReady); StartGame.setBackground(new java.awt.Color(153, 204, 255)); PlayGameButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/tubessister/rotate.png"))); // NOI18N PlayGameButton3.setMaximumSize(new java.awt.Dimension(230, 230)); PlayGameButton3.setMinimumSize(new java.awt.Dimension(230, 230)); PlayGameButton3.setPreferredSize(new java.awt.Dimension(230, 239)); ServerAddress6.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N ServerAddress6.setText("Initializing the game wait until at least 6 player ready to play the game"); javax.swing.GroupLayout StartGameLayout = new javax.swing.GroupLayout(StartGame); StartGame.setLayout(StartGameLayout); StartGameLayout .setHorizontalGroup(StartGameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, StartGameLayout.createSequentialGroup().addContainerGap(322, Short.MAX_VALUE) .addComponent(ServerAddress6).addGap(319, 319, 319)) .addGroup(StartGameLayout.createSequentialGroup().addGap(541, 541, 541) .addComponent(PlayGameButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); StartGameLayout.setVerticalGroup(StartGameLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(StartGameLayout.createSequentialGroup().addGap(325, 325, 325) .addComponent(PlayGameButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(ServerAddress6, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(235, Short.MAX_VALUE))); jLayeredPane1.add(StartGame); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 1135, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout .createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 560, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout .createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)))); pack(); }
From source file:ueg.watchdog.view.PersonDetection.java
/** * 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.//from ww w . j a va2 s .c o m */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanelDetectPerson = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jButtonCapture = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setResizable(false); javax.swing.GroupLayout jPanelDetectPersonLayout = new javax.swing.GroupLayout(jPanelDetectPerson); jPanelDetectPerson.setLayout(jPanelDetectPersonLayout); jPanelDetectPersonLayout.setHorizontalGroup(jPanelDetectPersonLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 594, Short.MAX_VALUE)); jPanelDetectPersonLayout.setVerticalGroup(jPanelDetectPersonLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 355, Short.MAX_VALUE)); jLabel1.setFont(new java.awt.Font("DejaVu Serif", 1, 18)); // NOI18N jLabel1.setText("WatchDog - Detect Person"); jButtonCapture.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N jButtonCapture.setText("Capture"); jButtonCapture.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonCaptureActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(36, 36, 36) .addComponent(jPanelDetectPerson, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(41, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 284, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(187, 187, 187)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jButtonCapture, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(252, 252, 252))))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanelDetectPerson, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(28, 28, 28).addComponent(jButtonCapture, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(15, Short.MAX_VALUE))); pack(); }
From source file:ueg.watchdog.view.Report.java
/** * 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./*from w w w . j ava 2s . c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jButtonPrint = new javax.swing.JButton(); birthdayValidatorLabel = new javax.swing.JLabel(); jDateChooserFrom = new com.toedter.calendar.JDateChooser(); jDateChooserTo = new com.toedter.calendar.JDateChooser(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setResizable(false); jLabel1.setFont(new java.awt.Font("DejaVu Serif", 1, 18)); // NOI18N jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("WatchDog - Report"); jLabel2.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N jLabel2.setText("Report Generation Period"); jLabel3.setText("Date (From) : "); jLabel4.setText("Date (To) : "); jLabel5.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N jButtonPrint.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N jButtonPrint.setText("Print Report"); jButtonPrint.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonPrintActionPerformed(evt); } }); jDateChooserFrom.setDateFormatString("yyyy-MM-dd"); jDateChooserTo.setDateFormatString("yyyy-MM-dd"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(104, 104, 104).addComponent( jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup().addGap(56, 56, 56).addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addGroup(layout.createSequentialGroup().addGap(124, 124, 124) .addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 128, Short.MAX_VALUE) .addComponent(jButtonPrint, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE))))) .addGap(52, 52, 52)) .addGroup(layout.createSequentialGroup().addGap(92, 92, 92) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jDateChooserFrom, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jDateChooserTo, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(26, 26, 26) .addComponent(birthdayValidatorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(35, 35, 35))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(21, 21, 21).addComponent(jLabel1).addGap(18, 18, 18) .addComponent(jLabel2).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3).addComponent(jDateChooserFrom, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jDateChooserTo, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32).addComponent(birthdayValidatorLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel4)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButtonPrint, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE) .addGap(54, 54, 54))); pack(); }