📄 objectviewerthemepropertiesframe.java
字号:
/*
* This file is part of the GeOxygene project source files.
*
* GeOxygene aims at providing an open framework which implements OGC/ISO specifications for
* the development and deployment of geographic (GIS) applications. It is a open source
* contribution of the COGIT laboratory at the Institut G閛graphique National (the French
* National Mapping Agency).
*
* See: http://oxygene-project.sourceforge.net
*
* Copyright (C) 2005 Institut G閛graphique National
*
* This library is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation;
* either version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this library (see file LICENSE if present); if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package fr.ign.cogit.geoxygene.util.viewer;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Vector;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import uk.ac.leeds.ccg.dbffile.Dbf;
import uk.ac.leeds.ccg.geotools.HSVShader;
import uk.ac.leeds.ccg.geotools.MonoShader;
import uk.ac.leeds.ccg.geotools.RandomShader;
import uk.ac.leeds.ccg.geotools.Shader;
import uk.ac.leeds.ccg.geotools.ShapefileReader;
import uk.ac.leeds.ccg.geotools.UniqueShader;
/**
* This class implements the frame for the defintion of properties of themes to be displayed
* in the (Geo)Object viewer.
*
* @author Thierry Badard & Arnaud Braun
* @version 1.0
*
*/
class ObjectViewerThemePropertiesFrame extends JFrame {
public static final String FRAME_TITLE =
"GeOxygene Object Viewer - Theme Properties";
private ObjectViewerThemeProperties objectViewerThemeProperties;
public ObjectViewerThemePropertiesFrame(ObjectViewerThemeProperties objectViewerThemeProperties) {
super(FRAME_TITLE);
this.objectViewerThemeProperties = objectViewerThemeProperties;
//Set up the theme properties panel
JTabbedPane themePropertiesTabbedPanel = new JTabbedPane();
JPanel themePropertiesPanel = new JPanel(new GridLayout(6, 2, 10, 10));
themePropertiesPanel.setBorder(
BorderFactory.createTitledBorder("Theme Properties"));
JPanel themeShadersPanel = new JPanel(new GridLayout(3, 2, 1, 50));
themeShadersPanel.setBorder(
BorderFactory.createTitledBorder("Shader Properties"));
//Add the components to the themePropertiesPanel
JLabel fillThemeColorLabel = new JLabel("Fill in Theme Color:");
Icon fillThemeColorButtonIcon =
new RectIcon(
getObjectViewerThemeProperties().getFillInThemeColor());
final JButton fillThemeColorButton =
new JButton(fillThemeColorButtonIcon);
fillThemeColorButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
final JFrame ccframe =
new ObjectViewerColorChooser(
((RectIcon) (fillThemeColorButton.getIcon()))
.getColor(),
fillThemeColorButton);
ccframe.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
ccframe.dispose();
}
});
ccframe.setResizable(false);
ccframe.pack();
ccframe.setVisible(true);
}
});
JLabel outlineThemeColorLabel = new JLabel("Outline Theme Color:");
Icon outlineThemeColorButtonIcon =
new RectIcon(
getObjectViewerThemeProperties().getOutlineThemeColor());
final JButton outlineThemeColorButton =
new JButton(outlineThemeColorButtonIcon);
outlineThemeColorButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
final JFrame ccframe =
new ObjectViewerColorChooser(
((RectIcon) (outlineThemeColorButton.getIcon()))
.getColor(),
outlineThemeColorButton);
ccframe.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
ccframe.dispose();
}
});
ccframe.setResizable(false);
ccframe.pack();
ccframe.setVisible(true);
}
});
JLabel fillHighlightColorLabel = new JLabel("Fill in Highlight Color:");
Icon fillHighlightColorButtonIcon =
new RectIcon(objectViewerThemeProperties.getFillInHighlightColor());
final JButton fillHighlightColorButton =
new JButton(fillHighlightColorButtonIcon);
fillHighlightColorButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
final JFrame ccframe =
new ObjectViewerColorChooser(
((RectIcon) (fillHighlightColorButton.getIcon()))
.getColor(),
fillHighlightColorButton);
ccframe.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
ccframe.dispose();
}
});
ccframe.setResizable(false);
ccframe.pack();
ccframe.setVisible(true);
}
});
JLabel outlineHighlightColorLabel =
new JLabel("Outline Highlight Color:");
Icon outlineHighlightColorButtonIcon =
new RectIcon(
getObjectViewerThemeProperties().getOutlineHighlightColor());
final JButton outlineHighlightColorButton =
new JButton(outlineHighlightColorButtonIcon);
outlineHighlightColorButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
final JFrame ccframe =
new ObjectViewerColorChooser(
((RectIcon) (outlineHighlightColorButton.getIcon()))
.getColor(),
outlineHighlightColorButton);
ccframe.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
ccframe.dispose();
}
});
ccframe.setResizable(false);
ccframe.pack();
ccframe.setVisible(true);
}
});
JLabel fillSelectionColorLabel = new JLabel("Fill in Selection Color:");
Icon fillSelectionColorButtonIcon =
new RectIcon(
getObjectViewerThemeProperties().getFillInSelectionColor());
final JButton fillSelectionColorButton =
new JButton(fillSelectionColorButtonIcon);
fillSelectionColorButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
final JFrame ccframe =
new ObjectViewerColorChooser(
((RectIcon) (fillSelectionColorButton.getIcon()))
.getColor(),
fillSelectionColorButton);
ccframe.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
ccframe.dispose();
}
});
ccframe.setResizable(false);
ccframe.pack();
ccframe.setVisible(true);
}
});
JLabel outlineSelectionColorLabel =
new JLabel("Outline Selection Color:");
Icon outlineSelectionColorButtonIcon =
new RectIcon(
getObjectViewerThemeProperties().getOutlineSelectionColor());
final JButton outlineSelectionColorButton =
new JButton(outlineSelectionColorButtonIcon);
outlineSelectionColorButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
final JFrame ccframe =
new ObjectViewerColorChooser(
((RectIcon) (outlineSelectionColorButton.getIcon()))
.getColor(),
outlineSelectionColorButton);
ccframe.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
ccframe.dispose();
}
});
ccframe.setResizable(false);
ccframe.pack();
ccframe.setVisible(true);
}
});
themePropertiesPanel.add(fillThemeColorLabel);
themePropertiesPanel.add(fillThemeColorButton);
themePropertiesPanel.add(outlineThemeColorLabel);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -