You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(3) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(15) |
Feb
(33) |
Mar
(35) |
Apr
(53) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <wu...@us...> - 2008-02-25 22:48:16
|
Revision: 59 http://davinspector.svn.sourceforge.net/davinspector/?rev=59&view=rev Author: wuest Date: 2008-02-25 14:48:12 -0800 (Mon, 25 Feb 2008) Log Message: ----------- Changed configuration dialogs to modal. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java 2008-02-25 21:32:20 UTC (rev 58) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java 2008-02-25 22:48:12 UTC (rev 59) @@ -38,6 +38,7 @@ import de.dlr.davinspector.common.Constant; import de.dlr.davinspector.common.Util; +import de.dlr.davinspector.ui.UIResource; /** * The about dialog displays information about the program. @@ -112,6 +113,8 @@ jContentPane.add(getJButtonOk(), BorderLayout.SOUTH); jContentPane.add(getJTextPane(), BorderLayout.CENTER); jContentPane.add(getJPanel(), BorderLayout.NORTH); +// jContentPane.setMargin(new Insets(10, 10, 10, 10)); + jContentPane.setBounds(10, 10, -1, -1); } return jContentPane; } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java 2008-02-25 21:32:20 UTC (rev 58) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java 2008-02-25 22:48:12 UTC (rev 59) @@ -126,6 +126,7 @@ this.setSize(Constant.UI_CONFIG_DIALOG_WIDTH, Constant.UI_CONFIG_DIALOG_HEIGHT); this.setTitle(Constant.APP_TITLE + " Configuration"); this.setContentPane(this.getJContentPane()); + this.setModal(true); Util.centerWindow((Window) this); // Load Configuration from file Configuration config = new Configuration(); Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java 2008-02-25 21:32:20 UTC (rev 58) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java 2008-02-25 22:48:12 UTC (rev 59) @@ -160,6 +160,7 @@ this.setSize(Constant.UI_PLUGIN_CONFIG_DIALOG_WIDTH, Constant.UI_PLUGIN_CONFIG_DIALOG_HEIGTH); this.setTitle(Constant.APP_TITLE + " Plugin Configuration Dialog"); this.setContentPane(getJContentPane()); + this.setModal(true); Util.centerWindow((Window) this); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-25 21:32:41
|
Revision: 58 http://davinspector.svn.sourceforge.net/davinspector/?rev=58&view=rev Author: wuest Date: 2008-02-25 13:32:20 -0800 (Mon, 25 Feb 2008) Log Message: ----------- Error: Lost button bar next to the vertical splitter after configuring plugins. Resolved. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-25 15:38:01 UTC (rev 57) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-25 21:32:20 UTC (rev 58) @@ -994,8 +994,9 @@ if (jSplitPaneHorizontal != null) { jTabbedPaneClient = null; jTabbedPaneServer = null; + jPanelRight = null; jSplitPaneHorizontal.setLeftComponent(getJTabbedPaneClient()); - jSplitPaneHorizontal.setRightComponent(getJTabbedPaneServer()); + jSplitPaneHorizontal.setRightComponent(getJPanelRight()); jSplitPaneHorizontal.setDividerLocation(DIVIDER_HORZ); jSplitPaneHorizontal.repaint(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-25 15:38:06
|
Revision: 57 http://davinspector.svn.sourceforge.net/davinspector/?rev=57&view=rev Author: wuest Date: 2008-02-25 07:38:01 -0800 (Mon, 25 Feb 2008) Log Message: ----------- Changed listener structure for client/server raw data. Now java.util.EventListener is used. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java trunk/DAVInspector/src/de/dlr/davinspector/relay/IClientListener.java trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java trunk/DAVInspector/src/de/dlr/davinspector/relay/IServerListener.java trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java Added Paths: ----------- trunk/DAVInspector/src/de/dlr/davinspector/relay/DataEvent.java Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java 2008-02-25 14:41:29 UTC (rev 56) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java 2008-02-25 15:38:01 UTC (rev 57) @@ -32,6 +32,7 @@ import javax.swing.event.EventListenerList; +import de.dlr.davinspector.relay.DataEvent; import de.dlr.davinspector.relay.IClientListener; import de.dlr.davinspector.relay.IRelayModel; import de.dlr.davinspector.relay.IServerListener; @@ -90,8 +91,8 @@ myClientsideBuffer = ""; myServersideBuffer = ""; - myRelay.registerClientListener((IClientListener) this); - myRelay.registerServerListener((IServerListener) this); + myRelay.addClientListener(this); + myRelay.addServerListener(this); } /** @@ -132,10 +133,10 @@ /** * {@inheritDoc} * - * @see de.dlr.davinspector.relay.IClientListener#updateClient(java.lang.String) + * @see de.dlr.davinspector.relay.IClientListener#newClientData(de.dlr.davinspector.relay.DataEvent) */ - public void updateClient(String data) { - myClientsideBuffer += data; + public void newClientData(DataEvent newDataEvent) { + myClientsideBuffer += newDataEvent.getData(); processRawData(); storeMessage(myClientsideBuffer, false, new Date()); myClientsideBuffer = ""; @@ -144,10 +145,10 @@ /** * {@inheritDoc} * - * @see de.dlr.davinspector.relay.IServerListener#updateServer(java.lang.String) + * @see de.dlr.davinspector.relay.IServerListener#newServerData(de.dlr.davinspector.relay.DataEvent) */ - public void updateServer(String data) { - myServersideBuffer += data; + public void newServerData(DataEvent newDataEvent) { + myServersideBuffer += newDataEvent.getData(); processRawData(); storeMessage(myServersideBuffer, true, new Date()); myServersideBuffer = ""; @@ -157,7 +158,7 @@ * Processes Client and Server data. * Data is split into messages by Content-Header-Length (if set) or EOF. * TODO: maybe here or in the message class itsself !? - * TODO: automatic end of message detection + * TODO: automatic end of message detection (interface for this would be nice) */ private void processRawData() { Added: trunk/DAVInspector/src/de/dlr/davinspector/relay/DataEvent.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/DataEvent.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/DataEvent.java 2008-02-25 15:38:01 UTC (rev 57) @@ -0,0 +1,69 @@ +/* + * DataEvent.java + * + * This class represents a data event. + * + * Created: 25.02.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.relay; + +import java.util.EventObject; + + +/** + * This class represents a data event. + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public class DataEvent extends EventObject { + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * The data. + */ + private String myData; + + /** + * Constructor for a new data event. + * + * @param source Object + * @param data String + */ + public DataEvent(Object source, String data) { + super(source); + myData = data; + } + + /** + * This method returns the current data. + * + * @return String + */ + public String getData() { + return myData; + } + +} Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/IClientListener.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/IClientListener.java 2008-02-25 14:41:29 UTC (rev 56) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/IClientListener.java 2008-02-25 15:38:01 UTC (rev 57) @@ -1,7 +1,7 @@ /* * IClientListener.java * - * Interface for client listeners. + * New data from client listener interface. * * Created: 29.01.2008 Jochen Wuest <joc...@dl...> * Changed: @@ -25,18 +25,21 @@ package de.dlr.davinspector.relay; +import java.util.EventListener; + /** - * TODO: wues_ha: Enter comment! + * New data from client listener interface. * * @version $LastChangedRevision$ * @author Jochen Wuest */ -public interface IClientListener { +public interface IClientListener extends EventListener { + /** - * TODO: wues_ha: Enter comment! + * Invoked when new data from the client has arrived. * - * @param data String + * @param newDataEvent {@link DataEvent} */ - void updateClient(String data); + void newClientData(DataEvent newDataEvent); } Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java 2008-02-25 14:41:29 UTC (rev 56) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java 2008-02-25 15:38:01 UTC (rev 57) @@ -51,46 +51,10 @@ * */ void stopRelay(); - + /** * TODO: wues_ha: Enter comment! - * @param cl ClientListener - */ - void registerClientListener(IClientListener cl); - - /** - * TODO: wues_ha: Enter comment! - * @param cl ClientListener - */ - void removeClientListener(IClientListener cl); - - /** - * TODO: wues_ha: Enter comment! * - */ - void notifyClientListeners(); - - /** - * TODO: wues_ha: Enter comment! - * @param sl ServerListener - */ - void registerServerListener(IServerListener sl); - - /** - * TODO: wues_ha: Enter comment! - * @param sl ServerListener - */ - void removeServerListener(IServerListener sl); - - /** - * TODO: wues_ha: Enter comment! - * - */ - void notifyServerListeners(); - - /** - * TODO: wues_ha: Enter comment! - * * @param data String */ void writeToClient(String data); @@ -123,4 +87,32 @@ * @return {@link MessageHistory} */ MessageHistory getMessageHistory(); + + /** + * Adds an {@link IServerListener} to RelayModel. + * + * @param listener the {@link IServerListener} to be added + */ + void addServerListener(IServerListener listener); + + /** + * Removes an {@link IServerListener} from RelayModel. + * + * @param listener the {@link IServerListener} to be removed + */ + void removeServerListener(IServerListener listener); + + /** + * Adds an {@link IClientListener} to RelayModel. + * + * @param listener the {@link IClientListener} to be added + */ + void addClientListener(IClientListener listener); + + /** + * Removes an {@link IClientListener} from RelayModel. + * + * @param listener the {@link IClientListener} to be removed + */ + void removeClientListener(IClientListener listener); } Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/IServerListener.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/IServerListener.java 2008-02-25 14:41:29 UTC (rev 56) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/IServerListener.java 2008-02-25 15:38:01 UTC (rev 57) @@ -1,7 +1,7 @@ /* * IServerListener.java * - * Interface for server listeners. + * New data from server listener interface. * * Created: 29.01.2008 Jochen Wuest <joc...@dl...> * Changed: @@ -22,21 +22,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + package de.dlr.davinspector.relay; +import java.util.EventListener; /** - * TODO: wues_ha: Enter comment! - * + * New data from server listener interface. + * * @version $LastChangedRevision$ * @author Jochen Wuest */ -public interface IServerListener { +public interface IServerListener extends EventListener { + /** - * TODO: wues_ha: Enter comment! + * Invoked when new data from the server has arrived. * - * @param data String + * @param newDataEvent {@link DataEvent} */ - void updateServer(String data); + void newServerData(DataEvent newDataEvent); } Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-02-25 14:41:29 UTC (rev 56) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-02-25 15:38:01 UTC (rev 57) @@ -36,6 +36,8 @@ import java.util.List; import java.util.Vector; +import javax.swing.event.EventListenerList; + import de.dlr.davinspector.common.Constant; import de.dlr.davinspector.configuration.Configuration; import de.dlr.davinspector.history.MessageHistory; @@ -50,15 +52,15 @@ public class RelayModel extends Thread implements IRelayModel { /** - * + * List of listeners for new client data. */ - private static List<IClientListener> clientListeners = new Vector<IClientListener>(); + private EventListenerList myClientListeners = new EventListenerList(); /** - * + * List of listeners for server data. */ - private static List<IServerListener> serverListeners = new Vector<IServerListener>(); - + private EventListenerList myServerListeners = new EventListenerList(); + /** * Address to forward connections to. */ @@ -130,73 +132,66 @@ /** * {@inheritDoc} * - * @see de.dlr.DAVInspector.Relay.IRelayModel#registerClientListener(de.dlr.DAVInspector.Relay.IClientListener) + * @see de.dlr.davinspector.relay.IRelayModel#addServerListener(de.dlr.davinspector.relay.IServerListener) */ - public void registerClientListener(IClientListener cl) { - clientListeners.add(cl); - } - + public void addServerListener(IServerListener listener) { + myServerListeners.add(IServerListener.class, listener); + } + /** * {@inheritDoc} * - * @see de.dlr.DAVInspector.Relay.IRelayModel#registerServerListener(de.dlr.DAVInspector.Relay.IServerListener) + * @see de.dlr.davinspector.relay.IRelayModel#removeServerListener(de.dlr.davinspector.relay.IServerListener) */ - public void registerServerListener(IServerListener sl) { - serverListeners.add(sl); - } - - /** - * {@inheritDoc} - * - * @see de.dlr.DAVInspector.Relay.IRelayModel#removeClientListener(de.dlr.DAVInspector.Relay.IClientListener) - */ - public void removeClientListener(IClientListener cl) { - int idx = clientListeners.indexOf(cl); - if (idx >= 0) { - clientListeners.remove(idx); + public void removeServerListener(IServerListener listener) { + myServerListeners.remove(IServerListener.class, listener); + } + + /** + * Notifies all {@link IServerListener}s that have registered interest for + * notification on an {@link DataEvent}. + * + * @param event the {@link DataEvent} object + */ + protected synchronized void notifyServerListeners(DataEvent event) { + for (IServerListener listener : myServerListeners.getListeners(IServerListener.class)) { + listener.newServerData(event); } - } - + } + /** * {@inheritDoc} * - * @see de.dlr.DAVInspector.Relay.IRelayModel#removeServerListener(de.dlr.DAVInspector.Relay.IServerListener) + * @see de.dlr.davinspector.relay.IRelayModel#addClientListener(de.dlr.davinspector.relay.IClientListener) */ - public void removeServerListener(IServerListener sl) { - int idx = serverListeners.indexOf(sl); - if (idx >= 0) { - serverListeners.remove(idx); - } - } - + public void addClientListener(IClientListener listener) { + myClientListeners.add(IClientListener.class, listener); + } + /** * {@inheritDoc} * - * @see de.dlr.DAVInspector.Relay.IRelayModel#notifyClientListeners() + * @see de.dlr.davinspector.relay.IRelayModel#removeClientListener(de.dlr.davinspector.relay.IClientListener) */ - public void notifyClientListeners() { - for (int i = 0; i < clientListeners.size(); i++) { - IClientListener cl = (IClientListener) clientListeners.get(i); - cl.updateClient(clientBuffer); + public void removeClientListener(IClientListener listener) { + myClientListeners.remove(IClientListener.class, listener); + } + + /** + * Notifies all {@link IClientListener}s that have registered interest for + * notification on an {@link DataEvent}. + * + * @param event the {@link DataEvent} object + */ + protected synchronized void notifyClientListeners(DataEvent event) { + for (IClientListener listener : myClientListeners.getListeners(IClientListener.class)) { + listener.newClientData(event); } - } + } - /** * {@inheritDoc} * - * @see de.dlr.DAVInspector.Relay.IRelayModel#notifyServerListeners() - */ - public void notifyServerListeners() { - for (int i = 0; i < serverListeners.size(); i++) { - IServerListener sl = (IServerListener) serverListeners.get(i); - sl.updateServer(serverBuffer); - } - } - - /** - * {@inheritDoc} - * * @see de.dlr.DAVInspector.Relay.IRelayModel#startRelay() */ public void startRelay(Configuration configuration, PrintStream outStream, PrintStream errStream) { @@ -348,9 +343,9 @@ */ public void notifyListeners(Boolean toClient) { if (toClient) { - notifyClientListeners(); + notifyClientListeners(new DataEvent(this, clientBuffer)); } else { - notifyServerListeners(); + notifyServerListeners(new DataEvent(this, serverBuffer)); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-25 14:41:34
|
Revision: 56 http://davinspector.svn.sourceforge.net/davinspector/?rev=56&view=rev Author: wuest Date: 2008-02-25 06:41:29 -0800 (Mon, 25 Feb 2008) Log Message: ----------- Added a tool bar and moved the send buttons next to the vertical splitter. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java 2008-02-25 10:39:11 UTC (rev 55) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java 2008-02-25 14:41:29 UTC (rev 56) @@ -154,6 +154,7 @@ jTextPane.setEditable(false); jTextPane.setText("\nVersion " + Constant.APP_VERSION + "\n\nApache 2.0 Lizenz\n(c) Copyright Jochen Wuest, DLR 2007-2008\n"); + // TODO: add icons and other stuff licenses } return jTextPane; } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-25 10:39:11 UTC (rev 55) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-25 14:41:29 UTC (rev 56) @@ -27,8 +27,7 @@ import java.awt.BorderLayout; import java.awt.Dimension; -import java.awt.GridBagLayout; -import java.awt.SystemColor; +import java.awt.Insets; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; @@ -36,8 +35,9 @@ import java.util.List; import javax.swing.AbstractAction; -import javax.swing.AbstractButton; import javax.swing.Action; +import javax.swing.Box; +import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JMenu; @@ -50,6 +50,7 @@ import javax.swing.JTable; import javax.swing.JTextPane; import javax.swing.JToggleButton; +import javax.swing.JToolBar; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; @@ -75,14 +76,14 @@ public class MainView implements INewMessageListener, IRefreshMessageListener { /** - * Position of the horizontal divider. (float, middle) + * Position of the horizontal divider. (float, middle) */ - private static final double DIVIDER_HORZ = 0.5; + private static final double DIVIDER_HORZ = 0.48; /** * Position of the vertical divider. (pixel) */ - private static final int DIVIDER_VERT = 450; + private static final double DIVIDER_VERT = 0.75; /** * Relay model. @@ -90,12 +91,27 @@ private IRelayModel myRelay; /** + * This panel contains the center buttons and the server tab pane. + */ + private JPanel jPanelRight; + + /** + * This panel contains the center buttons. + */ + private JPanel jPanelCenterButtons; + + /** + * The tool bar. + */ + private JToolBar jToolBar; + + /** * Controller. */ private IMainController myController; /** - * Main window. + * Main window. */ private JFrame jFrame = null; @@ -230,16 +246,6 @@ private JPanel jPanelHistory = null; /** - * Panel containing the control buttons for the relay. (left and right) - */ - private JPanel jPanelButtonBar = null; - - /** - * Panel containing the control buttons for the relay. (middle) - */ - private JPanel jPanelToggleButtonBar = null; - - /** * This table displays the history. */ private JTable jTableHistory = null; @@ -516,7 +522,7 @@ /** * TODO: Hmm, i do not like this! :-[ - * Maybe using of a configuraion change listener could improve this code + * Maybe the use of a configuration change listener could improve this code * * @return MainView */ @@ -563,11 +569,12 @@ jContentPane.setLayout(new BorderLayout()); jContentPane.setPreferredSize(new Dimension(Constant.UI_MAIN_WINDOW_WIDTH, Constant.UI_MAIN_WINDOW_HEIGHT)); jContentPane.add(getJSplitPaneVertical(), BorderLayout.CENTER); - jContentPane.add(getJPanelButtonBar(), BorderLayout.NORTH); + jContentPane.add(getJToolBar(), BorderLayout.NORTH); jContentPane.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent e) { // resize jSplitPaneHorizontal.setDividerLocation(DIVIDER_HORZ); + jSplitPaneVertical.setDividerLocation(DIVIDER_VERT); } }); } @@ -617,7 +624,8 @@ private JButton getJButtonSendToServer() { if (jBtnSendToServer == null) { jBtnSendToServer = new JButton(sendToServerAction); - jBtnSendToServer.setHorizontalTextPosition(AbstractButton.LEADING); + jBtnSendToServer.setHideActionText(true); + jBtnSendToServer.setMargin(new Insets(2, 2, 2, 2)); } return jBtnSendToServer; } @@ -630,7 +638,8 @@ private JButton getJButtonSendToClient() { if (jBtnSendToClient == null) { jBtnSendToClient = new JButton(sendToClientAction); - jBtnSendToClient.setIcon(UIResource.getIcon(UIResource.ICON_LEFT_ARROW)); + jBtnSendToClient.setHideActionText(true); + jBtnSendToClient.setMargin(new Insets(2, 2, 2, 2)); } return jBtnSendToClient; } @@ -645,7 +654,6 @@ jTextPaneClientRaw = new JTextPane(); jTextPaneClientRaw.setText(""); jTextPaneClientRaw.setEditable(true); - jTextPaneClientRaw.setBackground(SystemColor.info); } return jTextPaneClientRaw; } @@ -739,7 +747,8 @@ private JTextPane getJTextPaneServerRaw() { if (jTextPaneServerRaw == null) { jTextPaneServerRaw = new JTextPane(); - jTextPaneServerRaw.setBackground(SystemColor.info); + jTextPaneServerRaw.setText(""); + jTextPaneServerRaw.setEditable(true); } return jTextPaneServerRaw; } @@ -800,8 +809,8 @@ jMenuView.setText("View"); jMenuView.setMnemonic(KeyEvent.VK_V); jMenuView.add(getJMenuItemClearAll()); - jMenuView.add(getJMenuItemClearLeft()); - jMenuView.add(getJMenuItemClearRight()); + jMenuView.add(getJMenuItemClearClient()); + jMenuView.add(getJMenuItemClearServer()); } return jMenuView; } @@ -823,7 +832,7 @@ * * @return javax.swing.JMenuItem */ - private JMenuItem getJMenuItemClearLeft() { + private JMenuItem getJMenuItemClearClient() { if (jMenuItemClearLeft == null) { jMenuItemClearLeft = new JMenuItem(clearLeftAction); } @@ -835,7 +844,7 @@ * * @return javax.swing.JMenuItem */ - private JMenuItem getJMenuItemClearRight() { + private JMenuItem getJMenuItemClearServer() { if (jMenuItemClearRight == null) { jMenuItemClearRight = new JMenuItem(clearRightAction); } @@ -916,11 +925,67 @@ if (jSplitPaneHorizontal == null) { jSplitPaneHorizontal = new JSplitPane(); jSplitPaneHorizontal.setLeftComponent(getJTabbedPaneClient()); - jSplitPaneHorizontal.setRightComponent(getJTabbedPaneServer()); + jSplitPaneHorizontal.setRightComponent(getJPanelRight()); jSplitPaneHorizontal.setDividerLocation(DIVIDER_HORZ); } return jSplitPaneHorizontal; } + + /** + * This method initializes jPanelRight. + * This panel is placed right of the splitter and contains the center buttons and server tab pane. + * + * @return javax.swing.JPanel + */ + private JPanel getJPanelRight() { + if (jPanelRight == null) { + jPanelRight = new JPanel(); + jPanelRight.setLayout(new BorderLayout()); + jPanelRight.add(getJPanelCenterButtons(), BorderLayout.WEST); + jPanelRight.add(getJTabbedPaneServer(), BorderLayout.CENTER); + + } + return jPanelRight; + } + + /** + * This method initializes jToolBar. + * + * @return javax.swing.JToolBar + */ + private JToolBar getJToolBar() { + if (jToolBar == null) { + jToolBar = new JToolBar(); + jToolBar.setRollover(true); + jToolBar.add(sendToServerAction); + jToolBar.add(sendToClientAction); + jToolBar.addSeparator(); + jToolBar.add(getJToggleButtonRelay()); + jToolBar.add(getJToggleButtonAutomode()); + jToolBar.addSeparator(); + jToolBar.add(configurePluginsAction); + } + return jToolBar; + } + + /** + * This method initializes jPanelCenterButtons. + * These buttons are placed between the client and server tab panes. + * + * @return javax.swing.JPanel + */ + private JPanel getJPanelCenterButtons() { + if (jPanelCenterButtons == null) { + jPanelCenterButtons = new JPanel(); + jPanelCenterButtons.setLayout(new BoxLayout(jPanelCenterButtons, BoxLayout.Y_AXIS)); + jPanelCenterButtons.add(Box.createVerticalGlue()); + jPanelCenterButtons.add(getJButtonSendToServer()); + jPanelCenterButtons.add(Box.createRigidArea(new Dimension(0, 5))); + jPanelCenterButtons.add(getJButtonSendToClient()); + jPanelCenterButtons.add(Box.createVerticalGlue()); + } + return jPanelCenterButtons; + } /** * This method reloads the tab panes for client and server view. @@ -967,37 +1032,6 @@ } /** - * This method initializes jPanelButtonBar. - * - * @return javax.swing.JPanel - */ - private JPanel getJPanelButtonBar() { - if (jPanelButtonBar == null) { - jPanelButtonBar = new JPanel(); - jPanelButtonBar.setLayout(new BorderLayout()); - jPanelButtonBar.add(getJButtonSendToServer(), BorderLayout.WEST); - jPanelButtonBar.add(getJPanelToggleButtonBar(), BorderLayout.CENTER); - jPanelButtonBar.add(getJButtonSendToClient(), BorderLayout.EAST); - } - return jPanelButtonBar; - } - - /** - * This method initializes jPanelToggleButtonBar. - * - * @return javax.swing.JPanel - */ - private JPanel getJPanelToggleButtonBar() { - if (jPanelToggleButtonBar == null) { - jPanelToggleButtonBar = new JPanel(); - jPanelToggleButtonBar.setLayout(new GridBagLayout()); - jPanelToggleButtonBar.add(getJToggleButtonRelay()); - jPanelToggleButtonBar.add(getJToggleButtonAutomode(), null); - } - return jPanelToggleButtonBar; - } - - /** * This method initializes jTableHistory. * * @return javax.swing.JTable This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-25 11:07:59
|
Revision: 55 http://davinspector.svn.sourceforge.net/davinspector/?rev=55&view=rev Author: wuest Date: 2008-02-25 02:39:11 -0800 (Mon, 25 Feb 2008) Log Message: ----------- Addes method clear() to plugin interface. Plugins can now be configured via the plugin configuration dialog. Addes some documentation to relay package. Chunked messages can now be processed. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/package.html trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationTableCellRenderer.java trunk/DAVInspector/src/de/dlr/davinspector/ui/UIResource.java Modified: trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java 2008-02-22 12:51:46 UTC (rev 54) +++ trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java 2008-02-25 10:39:11 UTC (rev 55) @@ -173,6 +173,21 @@ public static final String RESOURCE_PATH = "/de/dlr/davinspector/resource/"; /** + * Column index of the enable/disable plugin for the client column in the plugin configuration dialog. + */ + public static final int PLUGIN_CONFIG_CLIENT_COL = 0; + + /** + * Column index of the enable/disable plugin for the server column in the plugin configuration dialog. + */ + public static final int PLUGIN_CONFIG_SERVER_COL = 1; + + /** + * Column index of the plugin name column in the plugin configuration dialog. + */ + public static final int PLUGIN_CONFIG_NAME_COL = 2; + + /** * Empty Constructor. */ private Constant() { Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java 2008-02-22 12:51:46 UTC (rev 54) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java 2008-02-25 10:39:11 UTC (rev 55) @@ -81,6 +81,11 @@ * @param msg Message */ void update(Message msg); + + /** + * Clears all data. + */ + void clear(); /** * Enable/disable the plugin. Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-02-22 12:51:46 UTC (rev 54) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-02-25 10:39:11 UTC (rev 55) @@ -29,10 +29,8 @@ import java.io.IOException; import java.net.URL; import java.net.URLClassLoader; -import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.util.Map; import java.util.Vector; import de.dlr.davinspector.common.Constant; @@ -55,11 +53,6 @@ private static PluginManager instance = new PluginManager(); /** - * - */ - private Map<String, URLClassLoader> loaderHashmap = new HashMap<String, URLClassLoader>(); - - /** * Vector containing all loaded plugins. */ private List<IPlugin> myPluginVector = new Vector<IPlugin>(); @@ -122,7 +115,14 @@ // ok, the plugin is initialized if (plugin != null) { myPluginVector.add(plugin); - loaderHashmap.put(name, jClassLoader); + + // TODO: only add plugin if specified for client/server side + plugin = (IPlugin) c.newInstance(); + plugin.init(); + myActivePluginsClient.add(plugin); + plugin = (IPlugin) c.newInstance(); + plugin.init(); + myActivePluginsServer.add(plugin); } } catch (ClassNotFoundException cnfe) { System.err.println(cnfe); @@ -195,7 +195,14 @@ * @param pluginNames Vector */ public void setActivePluginsClient(List<String> pluginNames) { - setActivePlugins(pluginNames, myActivePluginsClient); + // initialize client plugins + for (IPlugin plugin : myActivePluginsClient) { + plugin.setActive(false); + } + // activate / deactivate client plugins + for (IPlugin plugin : myActivePluginsClient) { + plugin.setActive(pluginNames.contains(plugin.getName())); + } } /** @@ -204,25 +211,33 @@ * @param pluginNames Vector */ public void setActivePluginsServer(List<String> pluginNames) { - setActivePlugins(pluginNames, myActivePluginsServer); + // initialize client plugins + for (IPlugin plugin : myActivePluginsServer) { + plugin.setActive(false); + } + // activate / deactivate server plugins + for (IPlugin plugin : myActivePluginsServer) { + plugin.setActive(pluginNames.contains(plugin.getName())); + } } + + /** + * This method clears all client plugins. + */ + public void clearActivePluginsClient() { + for (Iterator<IPlugin> iterator = myActivePluginsClient.iterator(); iterator.hasNext();) { + IPlugin plugin = (IPlugin) iterator.next(); + plugin.clear(); + } + } /** - * A vector of plugin names is used to build the vector of the active plugins. - * - * @param pluginNames Vector - * @param pluginVector Vector + * This method clears all server plugins. */ - private void setActivePlugins(List<String> pluginNames, List<IPlugin> pluginVector) { - // empty vector first - pluginVector.clear(); - for (IPlugin plugin : myPluginVector) { - for (String pluginName : pluginNames) { - if (plugin.getName() == pluginName) { - // add plugin - pluginVector.add(plugin); - } - } + public void clearActivePluginsServer() { + for (Iterator<IPlugin> iterator = myActivePluginsServer.iterator(); iterator.hasNext();) { + IPlugin plugin = (IPlugin) iterator.next(); + plugin.clear(); } - } + } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java 2008-02-22 12:51:46 UTC (rev 54) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java 2008-02-25 10:39:11 UTC (rev 55) @@ -1,9 +1,9 @@ /* * HeaderPlugin.java * - * TODO: wues_ha Enter comment! + * This class displays the header information. * - * Created: 22.01.2008 wues_ha <email> + * Created: 22.01.2008 Jochen Wuest <joc...@dl...> * Changed: * * $Id$ @@ -25,16 +25,15 @@ package de.dlr.davinspector.plugins.headerplugin; -import java.awt.SystemColor; - import javax.swing.JComponent; import javax.swing.JTextPane; +import de.dlr.davinspector.history.Message; import de.dlr.davinspector.plugin.IViewPlugin; /** - * TODO: wues_ha: Enter comment! + * This class displays the header information. * * @version $LastChangedRevision$ * @author Jochen Wuest @@ -42,14 +41,14 @@ public class HeaderPlugin implements IViewPlugin { /** - * + * State of the plugin. */ - private Boolean active = true; + private Boolean isActive = true; /** - * + * The text pane. */ - private JTextPane jTextPane = null; + private JTextPane myJTextPane = null; /** * {@inheritDoc} @@ -57,7 +56,7 @@ * @see de.dlr.DAVInspector.Plugin.IViewPlugin#getUI() */ public JComponent getUI() { - return jTextPane; + return myJTextPane; } /** @@ -93,7 +92,7 @@ * @see de.dlr.DAVInspector.Plugin.IPlugin#getType() */ public PlugInType getType() { - return PlugInType.VIEW_GENERAL; + return PlugInType.VIEW_CLIENT; } /** @@ -111,12 +110,11 @@ * @see de.dlr.DAVInspector.Plugin.IPlugin#init() */ public void init() { - if (jTextPane == null) { - jTextPane = new JTextPane(); - jTextPane.setEditable(false); - jTextPane.setBackground(SystemColor.yellow); + if (myJTextPane == null) { + myJTextPane = new JTextPane(); + myJTextPane.setEditable(false); } - jTextPane.setText(""); + myJTextPane.setText(""); } /** @@ -125,7 +123,7 @@ * @see de.dlr.DAVInspector.Plugin.IPlugin#isActive() */ public Boolean isActive() { - return active; + return isActive; } /** @@ -134,7 +132,7 @@ * @see de.dlr.DAVInspector.Plugin.IPlugin#setActive(java.lang.Boolean) */ public void setActive(Boolean state) { - active = state; + isActive = state; } /** @@ -142,9 +140,20 @@ * * @see de.dlr.DAVInspector.Plugin.IPlugin#update(java.lang.String) */ - public void update(String data) { - if (active) { - jTextPane.setText(data); + public void update(Message msg) { + if (isActive && myJTextPane != null) { + myJTextPane.setText(msg.getMessageHeader()); } } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IPlugin#clear() + */ + public void clear() { + if (myJTextPane != null) { + myJTextPane.setText(""); + } + } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/package.html =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/package.html 2008-02-22 12:51:46 UTC (rev 54) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/package.html 2008-02-25 10:39:11 UTC (rev 55) @@ -1,12 +1,6 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> -<html><head><title>BLUB B</title></head><body> - -BLUB B - -<h2>Package Specification</h2> - -BLUB B - +<html><head><title>Header Plugin</title></head><body> +This package contains all classes needed to display the headers of a message. </body></html> \ No newline at end of file Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java 2008-02-22 12:51:46 UTC (rev 54) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java 2008-02-25 10:39:11 UTC (rev 55) @@ -140,8 +140,19 @@ * @see de.dlr.DAVInspector.Plugin.IPlugin#update(java.lang.String) */ public void update(Message msg) { - if (isActive) { + if (isActive && myXMLTextPane != null) { myXMLTextPane.setText(msg.getMessageBody()); } } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IPlugin#clear() + */ + public void clear() { + if (myXMLTextPane != null) { + myXMLTextPane.setText(""); + } + } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java 2008-02-22 12:51:46 UTC (rev 54) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java 2008-02-25 10:39:11 UTC (rev 55) @@ -143,7 +143,7 @@ * @see de.dlr.DAVInspector.Plugin.IPlugin#update(java.lang.String) */ public void update(Message msg) { - if (isActive) { + if (isActive && myXMLTreeView != null) { updateTree(msg.getMessageBody()); } } @@ -162,4 +162,15 @@ System.err.println(ioe); } } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IPlugin#clear() + */ + public void clear() { + if (myXMLTreeView != null) { + updateTree(""); + } + } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java 2008-02-22 12:51:46 UTC (rev 54) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java 2008-02-25 10:39:11 UTC (rev 55) @@ -36,8 +36,8 @@ import de.dlr.davinspector.common.Constant; /** - * TODO: wues_ha: Enter comment! - * TODO: Buffer in ChannelThread for in / outhoing messages + * This class copies data from one socket to another. + * TODO: Buffer in ChannelThread for in / outgoing messages * * @version $LastChangedRevision$ * @author Jochen Wuest @@ -76,7 +76,7 @@ /** * */ - private String tname = ""; + private String myThreadName = ""; /** * @@ -129,15 +129,15 @@ count = in.read(buffer); } } catch (IOException ioe) { - errorPrintStream.println(tname + ioe); + errorPrintStream.println(myThreadName + ioe); } finally { // The input and output streams will be closed when the sockets themselves are closed. //# out.flush(); - errorPrintStream.println(tname + "flushing"); + errorPrintStream.println(myThreadName + "flushing"); flushOut(); } } catch (IOException ioe) { - errorPrintStream.println(tname + ioe); + errorPrintStream.println(myThreadName + ioe); } synchronized (myLock) { @@ -147,42 +147,44 @@ // Cleanup if there is only one peer OR if _both_ peers are done myInputSocket.close(); myOutputSocket.close(); - errorPrintStream.println(tname + "closing"); + errorPrintStream.println(myThreadName + "closing"); } else { // Signal the peer (if any) that we're done on this side of the connection // flushOut(); - errorPrintStream.println(tname + "interrupting peer"); + errorPrintStream.println(myThreadName + "interrupting peer"); myPeer.interrupt(); } } catch (IOException ioe) { - errorPrintStream.println(tname + COLON + ioe); + errorPrintStream.println(myThreadName + COLON + ioe); } finally { - errorPrintStream.println(tname + "removing connection"); + errorPrintStream.println(myThreadName + "removing connection"); myConnections.remove(this); } } } /** - * TODO: wues_ha: Enter comment! + * Defines whether this is a client or server connection.<br> + * true = from server to client<br> + * false = from client to server<br> * - * @param bToClient Boolean defines whether this is a client connection + * @param bToClient Boolean */ public void setToClient(boolean bToClient) { this.toClient = bToClient; } /** - * TODO: wues_ha: Enter comment! + * Returns the state of the writing process. * - * @return Boolean copying done. + * @return Boolean */ public boolean isDone() { return myDone; } /** - * TODO: wues_ha: Enter comment! + * This method sets the reference to <code>ChannelThread</code> for the opposite direction. * * @param peerChannelThread ChannelThread to peer to. */ @@ -191,58 +193,118 @@ } /** - * TODO: wues_ha: Enter comment! + * This method sets the thread name (for debugging purposes). * * @param threadName String thread name. */ public void setTName(String threadName) { - tname = threadName + ": "; + myThreadName = threadName + ": "; } /** - * TODO: wues_ha: Enter comment! + * This method writes data to the output stream. + * Chunked encoding is automatically * * @param data String data to send. */ public void writeOut(String data) { try { OutputStream out = myOutputSocket.getOutputStream(); - out.write(data.getBytes()); - out.flush(); + if (isChunked(data)) { + sendChunkedData(out, data); + } else { + out.write(data.getBytes()); + out.flush(); + } } catch (IOException ioe) { - errorPrintStream.println(tname + COLON + ioe); + errorPrintStream.println(myThreadName + COLON + ioe); } } /** - * TODO: wues_ha: Enter comment! - * + * This method flushes the output stream. */ private void flushOut() { try { myOutputSocket.getOutputStream().flush(); } catch (SocketException se) { - errorPrintStream.println(tname + COLON + se); + errorPrintStream.println(myThreadName + COLON + se); } catch (IOException ioe) { - errorPrintStream.println(tname + COLON + ioe); + errorPrintStream.println(myThreadName + COLON + ioe); } } /** - * TODO: wues_ha: Enter comment! + * Returns the thread name (for debugging purposes). * * @return String Threadname */ - public String getTName() { - return tname; + public String getThreadName() { + return myThreadName; } /** - * TODO: wues_ha: Enter comment! + * Returns the direction of the connection.<br> + * true = from server to client<br> + * false = from client to server<br> * * @return Boolean */ public Boolean getDirection() { return toClient; } + + /** + * Determines whether the data is chunked or not. + * + * @param data String data to send. + * @return Boolean Returns true if the data is chunked. + */ + private Boolean isChunked(String data) { + // TODO: RFC 2616 14.39 TE / 14.41 Transfer-Encoding + Boolean result = false; + if (data.contains("Transfer-Encoding: chunked")) { + result = true; + } + return result; + } + + /** + * Sends the chunked Data. Each chunk is send separately. + * + * @param outStream Socket to stream the data to. + * @param data String with the data to send. + */ + private void sendChunkedData(OutputStream outStream, String data) { + String buffer = ""; + Boolean header = true; + + // split the input in the different chunks. + // each chunk starts with the length of the chunk in hex. + String[] lines = data.split("(\r\n[0-9a-fA-F]+\r\n)"); + for (int i = 0; i < lines.length; i++) { + try { + if (header) { + buffer = lines[i]; + header = false; + } else { + buffer = lines[i]; + String chunkLength = Constant.LFCR + Integer.toHexString(lines[i].length()) + Constant.LFCR; + + // if the content of the chunk is empty, it is assumed that this is the last chunk. + // the last chunk is indicated by a length of zero followed by an empty line. + if (buffer.trim().isEmpty()) { + buffer = Constant.LFCR; + chunkLength = Constant.LFCR + "0" + Constant.LFCR; + } + buffer = chunkLength + buffer; + } + + outStream.write(buffer.getBytes()); + outStream.flush(); + } catch (IOException ioe) { + errorPrintStream.println(ioe); + } + } + } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-02-22 12:51:46 UTC (rev 54) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-02-25 10:39:11 UTC (rev 55) @@ -27,7 +27,6 @@ package de.dlr.davinspector.relay; import java.io.IOException; -import java.io.OutputStream; import java.io.PrintStream; import java.net.InetAddress; import java.net.ServerSocket; @@ -42,8 +41,9 @@ import de.dlr.davinspector.history.MessageHistory; /** - * TODO: wues_ha: Enter comment! - * + * Implementation of the relay interface. Provides the server socket + * and manages the channel threads. + * * @version $LastChangedRevision$ * @author Jochen Wuest */ @@ -53,6 +53,7 @@ * */ private static List<IClientListener> clientListeners = new Vector<IClientListener>(); + /** * */ @@ -118,7 +119,7 @@ } /** - * TODO: wues_ha: Enter comment! + * Returns the <code>MessageHistory</code>. * * @return MessageHistory */ @@ -295,62 +296,9 @@ } /** - * Determines whether the data is chunked or not. - * - * @param data String data to send. - * @return Boolean Returns true if the data is chunked. - */ - private Boolean isChunked(String data) { - // TODO: RFC 2616 14.39 TE / 14.41 Transfer-Encoding - Boolean result = false; - if (data.contains("Transfer-Encoding: chunked")) { - result = true; - } - return result; - } - - /** - * Sends the chunked Data. Each chunk is send separately. - * - * @param outStream Socket to stream the data to. - * @param data String with the data to send. - */ - private void sendChunkedData(OutputStream outStream, String data) { - String buffer = ""; - Boolean header = true; - - // split the input in the different chunks. - // each chunk starts with the length of the chunk in hex. - String[] lines = data.split("(\r\n[0-9a-fA-F]+\r\n)"); - for (int i = 0; i < lines.length; i++) { - try { - if (header) { - buffer = lines[i]; - header = false; - } else { - buffer = lines[i]; - String chunkLength = Constant.LFCR + Integer.toHexString(lines[i].length()) + Constant.LFCR; - - // if the content of the chunk is empty, it is assumed that this is the last chunk. - // the last chunk is indicated by a length of 0 followed by an empty line. - if (buffer.trim().isEmpty()) { - buffer = Constant.LFCR; - chunkLength = Constant.LFCR + "0" + Constant.LFCR; - } - buffer = chunkLength + buffer; - } - - outStream.write(buffer.getBytes()); - outStream.flush(); - } catch (IOException ioe) { - errorPrintStream.println(ioe); - } - } - } - - /** - * TODO: wues_ha: Enter comment! + * TODO: Enter comment! Not quite correct ... * + * * @param data String * @param toClient Boolean */ Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-22 12:51:46 UTC (rev 54) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-25 10:39:11 UTC (rev 55) @@ -362,13 +362,13 @@ public void actionPerformed(ActionEvent e) { if (myPluginConfigurationDialog == null) { - myPluginConfigurationDialog = new PluginConfigurationDialog(jFrame, myPluginManager); + myPluginConfigurationDialog = new PluginConfigurationDialog(jFrame, myPluginManager, getMain()); } myPluginConfigurationDialog.addPlugins(myPluginManager.getAvailablePlugins()); myPluginConfigurationDialog.setVisible(true); } }; - + /** * Action: Open about dialog. */ @@ -420,34 +420,36 @@ }; /** - * Action: Clear content of left raw pane. + * Action: Clear content of left (client) raw pane. */ private Action clearLeftAction = new AbstractAction() { static final long serialVersionUID = 1L; { - putValue(Action.NAME, "Clear Left"); + putValue(Action.NAME, "Clear Client"); putValue(Action.SHORT_DESCRIPTION, "Clear the Client side data."); - putValue(Action.SMALL_ICON, UIResource.getIcon(UIResource.ICON_CLEAR_LEFT)); + putValue(Action.SMALL_ICON, UIResource.getIcon(UIResource.ICON_CLEAR_CLIENT)); } public void actionPerformed(ActionEvent e) { jTextPaneClientRaw.setText(""); + myPluginManager.clearActivePluginsClient(); } }; /** - * Action: Clear content of right raw pane. + * Action: Clear content of right (server) raw pane. */ private Action clearRightAction = new AbstractAction() { static final long serialVersionUID = 1L; { - putValue(Action.NAME, "Clear Right"); + putValue(Action.NAME, "Clear Server"); putValue(Action.SHORT_DESCRIPTION, "Clear the Server side data."); - putValue(Action.SMALL_ICON, UIResource.getIcon(UIResource.ICON_CLEAR_RIGHT)); + putValue(Action.SMALL_ICON, UIResource.getIcon(UIResource.ICON_CLEAR_SERVER)); } public void actionPerformed(ActionEvent e) { jTextPaneServerRaw.setText(""); + myPluginManager.clearActivePluginsServer(); } }; @@ -465,6 +467,8 @@ public void actionPerformed(ActionEvent e) { jTextPaneServerRaw.setText(""); jTextPaneClientRaw.setText(""); + myPluginManager.clearActivePluginsClient(); + myPluginManager.clearActivePluginsServer(); } }; @@ -511,6 +515,16 @@ } /** + * TODO: Hmm, i do not like this! :-[ + * Maybe using of a configuraion change listener could improve this code + * + * @return MainView + */ + public MainView getMain() { + return this; + } + + /** * This method initializes jFrame. * * @return javax.swing.JFrame @@ -649,12 +663,14 @@ //update plugins if (myPluginManager != null) { List<IPlugin> plugged = myPluginManager.getActivePluginsClient(); - for (Iterator<IPlugin> iterator = plugged.iterator(); iterator.hasNext();) { + for (Iterator<IPlugin> iterator = plugged.iterator(); iterator.hasNext();) { IPlugin plugin = (IPlugin) iterator.next(); - IViewPlugin viewPlugin = (IViewPlugin) plugin; - JScrollPane jScrollPane = new JScrollPane(); - jScrollPane.setViewportView(viewPlugin.getUI()); - jTabbedPaneClient.addTab(viewPlugin.getName(), null, jScrollPane, null); + if (plugin.isActive()) { + IViewPlugin viewPlugin = (IViewPlugin) plugin; + JScrollPane jScrollPane = new JScrollPane(); + jScrollPane.setViewportView(viewPlugin.getUI()); + jTabbedPaneClient.addTab(viewPlugin.getName(), null, jScrollPane, null); + } } } } @@ -690,10 +706,12 @@ List<IPlugin> plugged = myPluginManager.getActivePluginsServer(); for (Iterator<IPlugin> iterator = plugged.iterator(); iterator.hasNext();) { IPlugin plugin = (IPlugin) iterator.next(); - IViewPlugin viewPlugin = (IViewPlugin) plugin; - JScrollPane jScrollPane = new JScrollPane(); - jScrollPane.setViewportView(viewPlugin.getUI()); - jTabbedPaneServer.addTab(viewPlugin.getName(), null, jScrollPane, null); + if (plugin.isActive()) { + IViewPlugin viewPlugin = (IViewPlugin) plugin; + JScrollPane jScrollPane = new JScrollPane(); + jScrollPane.setViewportView(viewPlugin.getUI()); + jTabbedPaneServer.addTab(viewPlugin.getName(), null, jScrollPane, null); + } } } } @@ -905,6 +923,20 @@ } /** + * This method reloads the tab panes for client and server view. + */ + public void refreshPluginTabPanes() { + if (jSplitPaneHorizontal != null) { + jTabbedPaneClient = null; + jTabbedPaneServer = null; + jSplitPaneHorizontal.setLeftComponent(getJTabbedPaneClient()); + jSplitPaneHorizontal.setRightComponent(getJTabbedPaneServer()); + jSplitPaneHorizontal.setDividerLocation(DIVIDER_HORZ); + jSplitPaneHorizontal.repaint(); + } + } + + /** * This method initializes jSplitPaneVertical. * * @return javax.swing.JSplitPane Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java 2008-02-22 12:51:46 UTC (rev 54) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java 2008-02-25 10:39:11 UTC (rev 55) @@ -96,6 +96,11 @@ * The plugin manager. */ private PluginManager myPluginManager = null; + + /** + * The main window. + */ + private MainView myMainView = null; /** * Table model of the plugin configuration table. @@ -107,10 +112,12 @@ * * @param owner Frame * @param pluginManager {@link PluginManager} + * @param main MainView */ - public PluginConfigurationDialog(Frame owner, PluginManager pluginManager) { + public PluginConfigurationDialog(Frame owner, PluginManager pluginManager, MainView main) { super(owner); myPluginManager = pluginManager; + myMainView = main; initialize(); } @@ -208,6 +215,8 @@ if (jTable == null) { myTableModel = new PluginConfigurationTableModel(); jTable = new JTable(myTableModel); + // do NOT allow reordering of the columns! + // in future you may enable this, but you also have to convert the column indices (view/table data model) jTable.getTableHeader().setReorderingAllowed(false); jTable.setDefaultRenderer(Boolean.class, new PluginConfigurationTableCellRenderer(myAvailablePlugins)); } @@ -218,7 +227,7 @@ * This method closes the window. */ public void closeWindow() { - // TODO: refresh/reload the tab panes in the main view + myMainView.refreshPluginTabPanes(); setVisible(false); dispose(); } @@ -232,14 +241,16 @@ List<String> clientPlugins = new Vector<String>(); List<String> serverPlugins = new Vector<String>(); for (int row = 0; row < myTableModel.getRowCount(); row++) { - String pluginName = (String) myTableModel.getValueAt(row, 2); //### + String pluginName = (String) myTableModel.getValueAt(row, Constant.PLUGIN_CONFIG_NAME_COL); Boolean[] pluginAvailable = myAvailablePlugins.get(pluginName); // only add the plugin names to active list of plugins, if the checkbox - // is checked and the plugin is enabled for current communication side - if (myTableModel.getValueAt(row, 0).equals(true) && pluginAvailable[0]) { //### + // is checked and the plugin is enabled for the current communication side + if (myTableModel.getValueAt(row, Constant.PLUGIN_CONFIG_CLIENT_COL).equals(true) + && pluginAvailable[Constant.PLUGIN_CONFIG_CLIENT_COL]) { clientPlugins.add(pluginName); } - if (myTableModel.getValueAt(row, 1).equals(true) && pluginAvailable[1]) { //### + if (myTableModel.getValueAt(row, Constant.PLUGIN_CONFIG_SERVER_COL).equals(true) + && pluginAvailable[Constant.PLUGIN_CONFIG_SERVER_COL]) { serverPlugins.add(pluginName); } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationTableCellRenderer.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationTableCellRenderer.java 2008-02-22 12:51:46 UTC (rev 54) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationTableCellRenderer.java 2008-02-25 10:39:11 UTC (rev 55) @@ -37,6 +37,8 @@ import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableCellRenderer; +import de.dlr.davinspector.common.Constant; + /** * This class implements a cell renderer for the check boxes to enable or disable * a plugin considering the availabilty of the plugins. @@ -84,7 +86,7 @@ checkBox.setOpaque(true); setToolTipText("Enable/Disable a plugin."); - String pluginName = table.getValueAt(row, table.convertColumnIndexToModel(2)).toString(); //### + String pluginName = table.getValueAt(row, table.convertColumnIndexToModel(Constant.PLUGIN_CONFIG_NAME_COL)).toString(); if (!isAvailable(pluginName, table.convertColumnIndexToModel(column))) { checkBox.setSelected(false); Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/UIResource.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/UIResource.java 2008-02-22 12:51:46 UTC (rev 54) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/UIResource.java 2008-02-25 10:39:11 UTC (rev 55) @@ -78,12 +78,12 @@ /** * */ - public static final String ICON_CLEAR_LEFT = "deleteleft.png"; + public static final String ICON_CLEAR_CLIENT = "deleteleft.png"; /** * */ - public static final String ICON_CLEAR_RIGHT = "deleteright.png"; + public static final String ICON_CLEAR_SERVER = "deleteright.png"; /** * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-22 12:51:48
|
Revision: 54 http://davinspector.svn.sourceforge.net/davinspector/?rev=54&view=rev Author: wuest Date: 2008-02-22 04:51:46 -0800 (Fri, 22 Feb 2008) Log Message: ----------- Added Comments. Implemented configuration of plugins for server and client side. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/DAVInspector.java trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/IEditPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/IViewPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java Modified: trunk/DAVInspector/src/de/dlr/davinspector/DAVInspector.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/DAVInspector.java 2008-02-22 12:46:54 UTC (rev 53) +++ trunk/DAVInspector/src/de/dlr/davinspector/DAVInspector.java 2008-02-22 12:51:46 UTC (rev 54) @@ -3,7 +3,7 @@ * * DAVInspector main class. * - * Created: 22.01.2008 wues_ha <email> + * Created: 22.01.2008 Jochen Wuest <joc...@dl...> * Changed: * * $Id$ @@ -31,7 +31,7 @@ /** - * TODO: wues_ha: Enter comment! + * DAVInspector main class. * * @version $LastChangedRevision$ * @author Jochen Wuest @@ -39,21 +39,18 @@ public final class DAVInspector { /** - * Hide utility class constructor. + * Hide class constructor. */ private DAVInspector() { } /** - * TODO: wues_ha: Enter comment! + * Main method. This starts the application. * * @param args String[] */ public static void main(String[] args) { - // FIXME: History Table not working - // FIXME: Debug notifier - // FIXME: stop service - // TODO: automatic end of message detection - + + // TODO: i18n //Locale loc = Locale.getDefault(); //Locale loc = Locale.GERMANY; //Locale loc = Locale.US; Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java 2008-02-22 12:46:54 UTC (rev 53) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java 2008-02-22 12:51:46 UTC (rev 54) @@ -49,7 +49,7 @@ private static final long serialVersionUID = 1L; /** - * Used to save the state of a message to color a complete row. + * Used to save the direction of a message to color a complete row. */ private Boolean isRequest; Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java 2008-02-22 12:46:54 UTC (rev 53) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java 2008-02-22 12:51:46 UTC (rev 54) @@ -157,6 +157,7 @@ * Processes Client and Server data. * Data is split into messages by Content-Header-Length (if set) or EOF. * TODO: maybe here or in the message class itsself !? + * TODO: automatic end of message detection */ private void processRawData() { Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugin/IEditPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/IEditPlugin.java 2008-02-22 12:46:54 UTC (rev 53) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/IEditPlugin.java 2008-02-22 12:51:46 UTC (rev 54) @@ -26,21 +26,22 @@ package de.dlr.davinspector.plugin; +import de.dlr.davinspector.history.Message; + /** - * TODO: wues_ha: Enter comment! + * This interface has to be implemented by plugins which allow the user to edit + * the traffic. * * @version $LastChangedRevision$ * @author Jochen Wuest */ public interface IEditPlugin extends IPlugin { /** - * Returns the processed data of the plugin. + * Returns the processed {@link Message} of the plugin. * - * @return String + * @return Message */ - String getOutput(); - - //### klasse!? -> verarbeitungsreihenfolge + Message getOutput(); } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java 2008-02-22 12:46:54 UTC (rev 53) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java 2008-02-22 12:51:46 UTC (rev 54) @@ -1,7 +1,7 @@ /* * IPlugin.java * - * General interface for plugins. + * General plugin interface definition. * * Created: 17.01.2008 Jochen Wuest <joc...@dl...> * Changed: @@ -22,107 +22,106 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + package de.dlr.davinspector.plugin; +import de.dlr.davinspector.history.Message; /** - * TODO: wues_ha: Enter comment! - * + * General plugin interface definition. + * * @version $LastChangedRevision$ * @author Jochen Wuest */ public interface IPlugin { + /** * Returns the version of the plugin. * - * @return int with version information + * @return int */ int getVersion(); - + /** - * Returns the type of the plugin. - * client/server - * view/edit + * Returns the type of the plugin. client/server view/edit * - * @return string + * @return string */ PlugInType getType(); - + /** * Returns the name of the plugin. * * @return String */ String getName(); - + /** * Returns the name of the author of the plugin. * * @return String */ String getAuthor(); - + /** * Returns the description of the plugin. * - * @return String + * @return String */ String getDescription(); - + /** * Initializes the plugin. - * */ void init(); - + /** - * Starts processing of the data. + * Starts processing of the message. * - * @param data String + * @param msg Message */ - void update(String data); - + void update(Message msg); + /** * Enable/disable the plugin. * * @param state Boolean */ void setActive(Boolean state); - + /** * Returns the current state of the plugin. * * @return Boolean */ Boolean isActive(); - + /** * Indentifier for plugin-type. */ public enum PlugInType { /** - * + * Plugin has GUI, client and server. */ VIEW_GENERAL, /** - * + * Plugin allows editing of the content, client and server. */ EDIT_GENERAL, /** - * + * Plugin has GUI, only client. */ - VIEW_CLIENT, + VIEW_CLIENT, /** - * + * Plugin has GUI, only server. */ VIEW_SERVER, /** - * + * Plugin allows editing of the content, only client. */ EDIT_CLIENT, /** - * + * Plugin allows editing of the content, only server. */ EDIT_SERVER } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugin/IViewPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/IViewPlugin.java 2008-02-22 12:46:54 UTC (rev 53) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/IViewPlugin.java 2008-02-22 12:51:46 UTC (rev 54) @@ -30,7 +30,7 @@ /** - * TODO: wues_ha: Enter comment! + * Interface which has to be implemented by plugins with visual components. * * @version $LastChangedRevision$ * @author Jochen Wuest Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-02-22 12:46:54 UTC (rev 53) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-02-22 12:51:46 UTC (rev 54) @@ -30,11 +30,13 @@ import java.net.URL; import java.net.URLClassLoader; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Vector; import de.dlr.davinspector.common.Constant; +import de.dlr.davinspector.history.Message; /** * This class loads all available plugins and manages the activated plugins @@ -60,7 +62,17 @@ /** * Vector containing all loaded plugins. */ - private List<IPlugin> pluginVector = new Vector<IPlugin>(); + private List<IPlugin> myPluginVector = new Vector<IPlugin>(); + + /** + * This list contains all plugins to view/edit messages to the server. + */ + private List<IPlugin> myActivePluginsServer = new Vector<IPlugin>(); + + /** + * This list contains all plugins to view/edit messages to the client. + */ + private List<IPlugin> myActivePluginsClient = new Vector<IPlugin>(); /** * Default constructor, @@ -109,7 +121,7 @@ plugin.init(); // ok, the plugin is initialized if (plugin != null) { - pluginVector.add(plugin); + myPluginVector.add(plugin); loaderHashmap.put(name, jClassLoader); } } catch (ClassNotFoundException cnfe) { @@ -130,6 +142,87 @@ * @return List pluginVector */ public List<IPlugin> getAvailablePlugins() { - return pluginVector; + return myPluginVector; } + + /** + * Returns Vector containing the active plugins on the client side. + * + * @return List pluginVector + */ + public List<IPlugin> getActivePluginsClient() { + return myActivePluginsClient; + } + + /** + * Returns Vector containing the active plugins on the server side. + * + * @return List pluginVector + */ + public List<IPlugin> getActivePluginsServer() { + return myActivePluginsServer; + } + + /** + * This method calls <code>update</code> with the given <code>message</code> + * for every plugin in the list of server plugins. + * + * @param message Message + */ + public void updateActivePluginsServer(Message message) { + for (Iterator<IPlugin> iterator = myActivePluginsServer.iterator(); iterator.hasNext();) { + IPlugin plugin = (IPlugin) iterator.next(); + plugin.update(message); + } + } + + /** + * This method calls <code>update</code> with the given <code>message</code> + * for every plugin in the list of client plugins. + * + * @param message Message + */ + public void updateActivePluginsClient(Message message) { + for (Iterator<IPlugin> iterator = myActivePluginsClient.iterator(); iterator.hasNext();) { + IPlugin plugin = (IPlugin) iterator.next(); + plugin.update(message); + } + } + + /** + * This method sets the active plugins for the client side. + * + * @param pluginNames Vector + */ + public void setActivePluginsClient(List<String> pluginNames) { + setActivePlugins(pluginNames, myActivePluginsClient); + } + + /** + * This method sets the active plugins for the server side. + * + * @param pluginNames Vector + */ + public void setActivePluginsServer(List<String> pluginNames) { + setActivePlugins(pluginNames, myActivePluginsServer); + } + + /** + * A vector of plugin names is used to build the vector of the active plugins. + * + * @param pluginNames Vector + * @param pluginVector Vector + */ + private void setActivePlugins(List<String> pluginNames, List<IPlugin> pluginVector) { + // empty vector first + pluginVector.clear(); + for (IPlugin plugin : myPluginVector) { + for (String pluginName : pluginNames) { + if (plugin.getName() == pluginName) { + // add plugin + pluginVector.add(plugin); + } + } + } + } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java 2008-02-22 12:46:54 UTC (rev 53) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java 2008-02-22 12:51:46 UTC (rev 54) @@ -51,19 +51,19 @@ /** * */ - private Socket inputSocket; + private Socket myInputSocket; /** * */ - private Socket outputSocket; + private Socket myOutputSocket; /** * */ - private boolean done = false; + private boolean myDone = false; /** * */ - private ChannelThread peer; + private ChannelThread myPeer; /** * */ @@ -81,29 +81,29 @@ /** * */ - private IRelayModel lock = null; + private IRelayModel myLock = null; /** * */ - private List<ChannelThread> connections; + private List<ChannelThread> myConnections; /** - * TODO: wues_ha: enter comment! + * Constructor. * - * @param inputSock Socket input socket - * @param outputSock Socket output socket - * @param lockRef lock object + * @param inputSocket Socket input socket + * @param outputSocket Socket output socket + * @param relay lock object * @param psErr Printstream for error messages - * @param con List + * @param connections List */ - public ChannelThread(Socket inputSock, Socket outputSock, IRelayModel lockRef, - PrintStream psErr, List<ChannelThread> con) { - this.inputSocket = inputSock; - this.outputSocket = outputSock; - this.lock = lockRef; + public ChannelThread(Socket inputSocket, Socket outputSocket, IRelayModel relay, + PrintStream psErr, List<ChannelThread> connections) { + this.myInputSocket = inputSocket; + this.myOutputSocket = outputSocket; + this.myLock = relay; this.errorPrintStream = psErr; - this.connections = con; + this.myConnections = connections; } /** @@ -112,19 +112,19 @@ * @see java.lang.Thread#run() */ public void run() { - byte[] buffer = new byte[Constant.PROXY_RECVBUFFERSIZE]; + byte[] buffer = new byte[Constant.RELAY_RECVBUFFERSIZE]; int count = Constant.EOF; try { - InputStream in = inputSocket.getInputStream(); + InputStream in = myInputSocket.getInputStream(); //# OutputStream out = outSock.getOutputStream(); try { count = in.read(buffer); while ((count != Constant.EOF) && !isInterrupted()) { //# out.write(buf, 0, count); - synchronized (lock) { - lock.updateData(new String(buffer, 0, count, "utf-8"), toClient); - lock.notifyListeners(toClient); + synchronized (myLock) { + myLock.updateData(new String(buffer, 0, count, "utf-8"), toClient); + myLock.notifyListeners(toClient); } count = in.read(buffer); } @@ -140,25 +140,25 @@ errorPrintStream.println(tname + ioe); } - synchronized (lock) { - done = true; + synchronized (myLock) { + myDone = true; try { - if ((peer == null) || peer.isDone()) { + if ((myPeer == null) || myPeer.isDone()) { // Cleanup if there is only one peer OR if _both_ peers are done - inputSocket.close(); - outputSocket.close(); + myInputSocket.close(); + myOutputSocket.close(); errorPrintStream.println(tname + "closing"); } else { // Signal the peer (if any) that we're done on this side of the connection // flushOut(); errorPrintStream.println(tname + "interrupting peer"); - peer.interrupt(); + myPeer.interrupt(); } } catch (IOException ioe) { errorPrintStream.println(tname + COLON + ioe); } finally { errorPrintStream.println(tname + "removing connection"); - connections.remove(this); + myConnections.remove(this); } } } @@ -178,7 +178,7 @@ * @return Boolean copying done. */ public boolean isDone() { - return done; + return myDone; } /** @@ -187,7 +187,7 @@ * @param peerChannelThread ChannelThread to peer to. */ public void setPeer(ChannelThread peerChannelThread) { - peer = peerChannelThread; + myPeer = peerChannelThread; } /** @@ -206,7 +206,7 @@ */ public void writeOut(String data) { try { - OutputStream out = outputSocket.getOutputStream(); + OutputStream out = myOutputSocket.getOutputStream(); out.write(data.getBytes()); out.flush(); } catch (IOException ioe) { @@ -220,7 +220,7 @@ */ private void flushOut() { try { - outputSocket.getOutputStream().flush(); + myOutputSocket.getOutputStream().flush(); } catch (SocketException se) { errorPrintStream.println(tname + COLON + se); } catch (IOException ioe) { Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java 2008-02-22 12:46:54 UTC (rev 53) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java 2008-02-22 12:51:46 UTC (rev 54) @@ -28,6 +28,7 @@ import java.io.PrintStream; import de.dlr.davinspector.configuration.Configuration; +import de.dlr.davinspector.history.MessageHistory; /** @@ -115,4 +116,11 @@ * @param toClient Boolean */ void notifyListeners(Boolean toClient); + + /** + * TODO: wues_ha: Enter comment! + * + * @return {@link MessageHistory} + */ + MessageHistory getMessageHistory(); } Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-02-22 12:46:54 UTC (rev 53) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-02-22 12:51:46 UTC (rev 54) @@ -34,12 +34,12 @@ import java.net.Socket; import java.net.SocketException; import java.net.UnknownHostException; -import java.util.Iterator; import java.util.List; import java.util.Vector; import de.dlr.davinspector.common.Constant; import de.dlr.davinspector.configuration.Configuration; +import de.dlr.davinspector.history.MessageHistory; /** * TODO: wues_ha: Enter comment! @@ -103,15 +103,28 @@ * Contains all current connections (ChannelThreads). */ private List<ChannelThread> connections = new Vector<ChannelThread>(); - - + /** + * + */ + private MessageHistory messageHistory = null; //new MessageHistory(); + + /** * TODO: wues_ha: enter comment! * */ public RelayModel() { - + messageHistory = new MessageHistory(this); } + + /** + * TODO: wues_ha: Enter comment! + * + * @return MessageHistory + */ + public MessageHistory getMessageHistory() { + return messageHistory; + } /** * {@inheritDoc} @@ -193,9 +206,9 @@ this.outPrintStream = outStream; this.errorPrintStream = errStream; if (clientAddress == null) { - this.serverSocket = new ServerSocket(configuration.getClientPort(), Constant.PROXY_BACKLOG); + this.serverSocket = new ServerSocket(configuration.getClientPort(), Constant.RELAY_BACKLOG); } else { - this.serverSocket = new ServerSocket(configuration.getClientPort(), Constant.PROXY_BACKLOG, clientAddress); + this.serverSocket = new ServerSocket(configuration.getClientPort(), Constant.RELAY_BACKLOG, clientAddress); } this.destinationAddress = serverAddress; this.destinationPort = configuration.getServerPort(); @@ -220,9 +233,9 @@ try { clientBuffer = ""; serverBuffer = ""; - serverSideSocket.setSoLinger(true, Constant.PROXY_LINGERTIME); + serverSideSocket.setSoLinger(true, Constant.RELAY_LINGERTIME); Socket clientSideSocket = new Socket(destinationAddress, destinationPort); - clientSideSocket.setSoLinger(true, Constant.PROXY_LINGERTIME); + clientSideSocket.setSoLinger(true, Constant.RELAY_LINGERTIME); ChannelThread serverToClientChannel = new ChannelThread(serverSideSocket, clientSideSocket, (IRelayModel) this, errorPrintStream, connections); ChannelThread clientToServerChannel = new ChannelThread(clientSideSocket, serverSideSocket, @@ -273,7 +286,7 @@ while (connections.size() > 0) { ChannelThread channelThread = (ChannelThread) connections.get(0); channelThread.interrupt(); - channelThread.join(Constant.PROXY_THREADTIMEOUT); + channelThread.join(Constant.RELAY_THREADTIMEOUT); } } catch (InterruptedException ie) { errorPrintStream.println(ie); @@ -288,7 +301,7 @@ * @return Boolean Returns true if the data is chunked. */ private Boolean isChunked(String data) { - //TODO: RFC 2616 14.39 TE / 14.41 Transfer-Encoding + // TODO: RFC 2616 14.39 TE / 14.41 Transfer-Encoding Boolean result = false; if (data.contains("Transfer-Encoding: chunked")) { result = true; @@ -373,7 +386,6 @@ * @see de.dlr.DAVInspector.Relay.IRelayModel#updateData(java.lang.String, java.lang.Boolean) */ public void updateData(String data, Boolean toClient) { -// System.out.println("UD " + toClient); if (toClient) { clientBuffer += data; } else { @@ -387,7 +399,6 @@ * @see de.dlr.DAVInspector.Relay.IRelayModel#notifyListeners(java.lang.Boolean) */ public void notifyListeners(Boolean toClient) { -// System.out.println("NL " + toClient); if (toClient) { notifyClientListeners(); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-22 12:47:03
|
Revision: 53 http://davinspector.svn.sourceforge.net/davinspector/?rev=53&view=rev Author: wuest Date: 2008-02-22 04:46:54 -0800 (Fri, 22 Feb 2008) Log Message: ----------- Completed and corrected Comments and package description. Added TableCellRenderer for PluginConfigurationDialog. Implemented configuring of the plugins for server and client. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainController.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationTableModel.java trunk/DAVInspector/src/de/dlr/davinspector/ui/UIResource.java trunk/DAVInspector/src/de/dlr/davinspector/ui/package.html Added Paths: ----------- trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationTableCellRenderer.java Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java 2008-02-21 10:33:17 UTC (rev 52) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java 2008-02-22 12:46:54 UTC (rev 53) @@ -1,7 +1,7 @@ /* * AboutDialog.java * - * TODO: wues_ha Enter comment! + * The about dialog displays information about the program. * * Created: 16.01.2008 Jochen Wuest <joc...@dl...> * Changed: @@ -40,7 +40,7 @@ import de.dlr.davinspector.common.Util; /** - * TODO: wues_ha: Enter comment! + * The about dialog displays information about the program. * * @version $LastChangedRevision$ * @author Jochen Wuest @@ -60,7 +60,7 @@ /** * */ - private JButton jButton = null; + private JButton jButtonOk = null; /** * @@ -75,12 +75,12 @@ /** * */ - private JLabel jLabel1 = null; + private JLabel jLabelAppIcon = null; /** * */ - private JLabel jLabel = null; + private JLabel jLabelAppName = null; /** * @param owner Parent Frame @@ -109,7 +109,7 @@ if (jContentPane == null) { jContentPane = new JPanel(); jContentPane.setLayout(new BorderLayout()); - jContentPane.add(getJButton(), BorderLayout.SOUTH); + jContentPane.add(getJButtonOk(), BorderLayout.SOUTH); jContentPane.add(getJTextPane(), BorderLayout.CENTER); jContentPane.add(getJPanel(), BorderLayout.NORTH); } @@ -117,8 +117,7 @@ } /** - * TODO: wues_ha: Enter comment! - * + * This method closes the window. */ public void closeWindow() { this.setVisible(false); @@ -130,17 +129,17 @@ * * @return javax.swing.JButton */ - private JButton getJButton() { - if (jButton == null) { - jButton = new JButton(); - jButton.setText("Ok"); - jButton.addActionListener(new java.awt.event.ActionListener() { + private JButton getJButtonOk() { + if (jButtonOk == null) { + jButtonOk = new JButton(); + jButtonOk.setText("Ok"); + jButtonOk.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { closeWindow(); } }); } - return jButton; + return jButtonOk; } /** @@ -166,19 +165,14 @@ */ private JPanel getJPanel() { if (jPanel == null) { - //ImageIcon iiLogo = createImageIcon("icons/davinspector_trans.gif", ""); - //JLabel logo = new JLabel(iiLogo); - //logo.setHorizontalAlignment(AbstractButton.CENTER); - //jPanel.add(logo, BorderLayout.NORTH); - - jLabel = new JLabel(); - jLabel.setText(" " + Constant.APP_TITLE); - jLabel1 = new JLabel(); - jLabel1.setIcon(UIResource.getIcon(UIResource.ICON_APP32)); + jLabelAppName = new JLabel(); + jLabelAppName.setText(" " + Constant.APP_TITLE); + jLabelAppIcon = new JLabel(); + jLabelAppIcon.setIcon(UIResource.getIcon(UIResource.ICON_APP32)); jPanel = new JPanel(); jPanel.setLayout(new BorderLayout()); - jPanel.add(jLabel1, BorderLayout.WEST); - jPanel.add(jLabel, BorderLayout.CENTER); + jPanel.add(jLabelAppIcon, BorderLayout.WEST); + jPanel.add(jLabelAppName, BorderLayout.CENTER); } return jPanel; } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java 2008-02-21 10:33:17 UTC (rev 52) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java 2008-02-22 12:46:54 UTC (rev 53) @@ -1,7 +1,7 @@ /* * ConfigurationDialog.java * - * TODO: wues_ha Enter comment! + * Displays the configuration dialog to configure the application. * * Created: 19.12.2007 Jochen Wuest <joc...@dl...> * Changed: @@ -42,7 +42,7 @@ import de.dlr.davinspector.configuration.Configuration; /** - * TODO: wues_ha: Enter comment! + * Displays the configuration dialog to configure the application. * * @version $LastChangedRevision$ * @author Jochen Wuest @@ -53,52 +53,66 @@ * */ private static final long serialVersionUID = 1L; + /** * */ private JPanel jContentPane = null; + /** * */ private JLabel jLabelServerPort = null; + /** * */ private JLabel jLabelClientAddress = null; + /** * */ private JLabel jLabelClientPort = null; + /** * */ private JLabel jLabelServerAddress = null; + /** * */ private JButton jButtonCancel = null; + /** * */ private JTextField jTextFieldClientPort = null; + /** * */ private JTextField jTextFieldServerPort = null; + /** * */ private JTextField jTextFieldServerAddress = null; + /** * */ private JTextField jTextFieldClientAddress = null; + /** * */ private JButton jButtonOk = null; + /** - * @param owner Owner of the Dialog. + * Constructor of the configuration dialog. + * + * @param owner Frame */ public ConfigurationDialog(Frame owner) { super(owner); @@ -158,7 +172,7 @@ } /** - * This method initializes jButton. + * This method initializes jButtonCancel. * * @return javax.swing.JButton */ @@ -178,8 +192,7 @@ } /** - * TODO: wues_ha: Enter comment! - * + * This method closes the window. */ public void closeWindow() { this.setVisible(false); @@ -187,8 +200,7 @@ } /** - * TODO: wues_ha: Enter comment! - * + * This method saves the current configuration. */ public void saveConfiguration() { Configuration config = new Configuration(); @@ -197,62 +209,63 @@ config.setServerAddress(jTextFieldServerAddress.getText()); config.setServerPort(jTextFieldServerPort.getText()); config.storeConfiguration(); - // TODO: aktualisierung proxy!! ### + // TODO: refresh/restart the relay with the new configuration } /** - * This method initializes jTextField. + * This method initializes jTextFieldClientPort. * * @return javax.swing.JTextField */ private JTextField getJTextFieldClientPort() { if (jTextFieldClientPort == null) { jTextFieldClientPort = new JTextField(); - jTextFieldClientPort.setText("8888"); + jTextFieldClientPort.setText(String.valueOf(Constant.RELAY_CLIENTPORT)); } return jTextFieldClientPort; } /** - * This method initializes jTextField1. + * This method initializes jTextFieldServerPort. * * @return javax.swing.JTextField */ private JTextField getJTextFieldServerPort() { if (jTextFieldServerPort == null) { jTextFieldServerPort = new JTextField(); - jTextFieldServerPort.setText("8080"); + jTextFieldServerPort.setText(String.valueOf(Constant.RELAY_SERVERPORT)); } return jTextFieldServerPort; } /** - * This method initializes jTextField2. + * This method initializes jTextFieldServerAddress. * * @return javax.swing.JTextField */ private JTextField getJTextFieldServerAddress() { if (jTextFieldServerAddress == null) { jTextFieldServerAddress = new JTextField(); - jTextFieldServerAddress.setText("localhost"); + jTextFieldServerAddress.setText(Constant.RELAY_SERVERADDRESS); } return jTextFieldServerAddress; } /** - * This method initializes jTextField3. + * This method initializes jTextFieldClientAddress. * * @return javax.swing.JTextField */ private JTextField getJTextFieldClientAddress() { if (jTextFieldClientAddress == null) { jTextFieldClientAddress = new JTextField(); + jTextFieldClientAddress.setText(Constant.RELAY_CLIENTADDRESS); } return jTextFieldClientAddress; } /** - * This method initializes jButton1. + * This method initializes jButtonOk. * * @return javax.swing.JButton */ @@ -270,5 +283,4 @@ } return jButtonOk; } - } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/MainController.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainController.java 2008-02-21 10:33:17 UTC (rev 52) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/MainController.java 2008-02-22 12:46:54 UTC (rev 53) @@ -1,7 +1,7 @@ /* * MainController.java * - * TODO: wues_ha Enter comment! + * This class is the controller for the relay model. * * Created: 29.01.2008 Jochen Wuest <joc...@dl...> * Changed: @@ -30,7 +30,7 @@ /** - * TODO: wues_ha: Enter comment! + * This class is the controller for the relay model. * * @version $LastChangedRevision$ * @author Jochen W\xFCst @@ -40,21 +40,21 @@ /** * */ - private IRelayModel relay; + private IRelayModel myRelay; /** * */ - private MainView view; + private MainView myView; /** - * TODO: wues_ha: enter comment! + * Constructor of the MainController. * * @param model RelayModelInterface */ public MainController(IRelayModel model) { - relay = model; - view = new MainView(this, relay); + myRelay = model; + myView = new MainView(this, myRelay); } /** @@ -64,7 +64,7 @@ */ public void startRelay() { Configuration config = new Configuration(); - relay.startRelay(config, System.out, System.err); + myRelay.startRelay(config, System.out, System.err); } /** @@ -73,7 +73,7 @@ * @see de.dlr.DAVInspector.UI.IMainController#stopRelay() */ public void stopRelay() { - relay.stopRelay(); + myRelay.stopRelay(); } /** @@ -82,7 +82,7 @@ * @see de.dlr.DAVInspector.UI.IMainController#writeToClient(java.lang.String) */ public void writeToClient(String data) { - relay.writeToClient(data); + myRelay.writeToClient(data); } /** @@ -91,6 +91,6 @@ * @see de.dlr.DAVInspector.UI.IMainController#writeToServer(java.lang.String) */ public void writeToServer(String data) { - relay.writeToServer(data); + myRelay.writeToServer(data); } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-21 10:33:17 UTC (rev 52) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-22 12:46:54 UTC (rev 53) @@ -1,7 +1,7 @@ /* * MainView.java * - * TODO: wues_ha Enter comment! + * The main window of the application. * * Created: 09.11.2007 Jochen Wuest <joc...@dl...> * Changed: @@ -50,236 +50,234 @@ import javax.swing.JTable; import javax.swing.JTextPane; import javax.swing.JToggleButton; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; import de.dlr.davinspector.common.Constant; import de.dlr.davinspector.common.Util; import de.dlr.davinspector.history.HistoryTableCellRenderer; import de.dlr.davinspector.history.HistoryTableModel; +import de.dlr.davinspector.history.INewMessageListener; +import de.dlr.davinspector.history.IRefreshMessageListener; +import de.dlr.davinspector.history.Message; +import de.dlr.davinspector.history.MessageEvent; import de.dlr.davinspector.plugin.IPlugin; -import de.dlr.davinspector.plugin.IPlugin.PlugInType; import de.dlr.davinspector.plugin.IViewPlugin; import de.dlr.davinspector.plugin.PluginManager; -import de.dlr.davinspector.relay.IClientListener; import de.dlr.davinspector.relay.IRelayModel; -import de.dlr.davinspector.relay.IServerListener; /** - * TODO: wues_ha: Enter comment! - * TODO: aktualisierung auf server und clientseite verbessern. + * The main window of the application. * * @version $LastChangedRevision$ * @author Jochen Wuest */ -public class MainView implements IClientListener, IServerListener { +public class MainView implements INewMessageListener, IRefreshMessageListener { /** - * + * Position of the horizontal divider. (float, middle) */ private static final double DIVIDER_HORZ = 0.5; /** - * + * Position of the vertical divider. (pixel) */ private static final int DIVIDER_VERT = 450; /** - * + * Relay model. */ - private IRelayModel relay; + private IRelayModel myRelay; + /** - * + * Controller. */ - private IMainController controller; + private IMainController myController; /** - * + * Main window. */ - private JFrame jFrame = null; // @jve:decl-index=0:visual-constraint="115,38" + private JFrame jFrame = null; /** - * + * Content pane. */ private JPanel jContentPane = null; + /** - * + * Horizontal splitter. */ - private JSplitPane jSplitPane = null; + private JSplitPane jSplitPaneHorizontal = null; + /** - * + * Button "send to server". */ private JButton jBtnSendToServer = null; + /** - * + * Menu bar. */ private JMenuBar jJMenuBar = null; + /** - * + * File menu. */ - private JMenu jMenu = null; + private JMenu jMenuFile = null; + /** - * + * Menu item "exit". */ - private JMenuItem jMenuItem = null; + private JMenuItem jMenuItemExit = null; + /** - * + * View menu. */ - private JMenu jMenu1 = null; + private JMenu jMenuView = null; + /** - * + * Menu item "clear all". */ - private JMenuItem jMenuItem1 = null; + private JMenuItem jMenuItemClearAll = null; + /** - * + * Button "send to client". */ private JButton jBtnSendToClient = null; + /** - * + * Menu item "clear left". */ - private JMenuItem jMenuItem2 = null; + private JMenuItem jMenuItemClearLeft = null; + /** - * + * Menu item "clear right". */ - private JMenuItem jMenuItem3 = null; + private JMenuItem jMenuItemClearRight = null; + /** - * + * Client text pane. */ private JTextPane jTextPaneClientRaw = null; /** - * + * Client tab pane. */ - private String clientHeader = ""; // @jve:decl-index=0: - /** - * - */ - private String clientBody = ""; // @jve:decl-index=0: - /** - * - */ - private String serverHeader = ""; // @jve:decl-index=0: - /** - * - */ - private String serverBody = ""; // @jve:decl-index=0: - - /** - * - */ private JTabbedPane jTabbedPaneClient = null; + /** - * + * Scroll pane for client text pane. */ private JScrollPane jScrollPaneClientRaw = null; /** - * + * Help menu. */ - private JMenu jMenu2 = null; + private JMenu jMenuHelp = null; /** - * + * Menu item "configure". */ - private JMenuItem jMenuItem4 = null; + private JMenuItem jMenuItemConfigure = null; /** - * + * Server tab pane. */ private JTabbedPane jTabbedPaneServer = null; /** - * + * Scroll pane for server text pane. */ - private JScrollPane getJScrollPaneServerRaw = null; + private JScrollPane jScrollPaneServerRaw = null; /** - * + * Server text pane. */ private JTextPane jTextPaneServerRaw = null; /** - * + * Menu item "aboout". */ - private JMenuItem jMenuItem5 = null; + private JMenuItem jMenuItemAbout = null; /** - * + * Plugin menu. */ - private JMenu jMenu3 = null; + private JMenu jMenuPlugins = null; /** - * + * Menu item "configure plugins". */ - private JMenuItem jMenuItem6 = null; + private JMenuItem jMenuItemConfigurePlugins = null; /** - * + * Configuration dialog. */ - private ConfigurationDialog configDialog = null; + private ConfigurationDialog myConfigDialog = null; /** - * + * Plugin configuration dialog. */ - private PluginConfigurationDialog pluginConfigDialog = null; + private PluginConfigurationDialog myPluginConfigurationDialog = null; /** - * + * Vertical Splitter. */ - private JSplitPane jSplitPane1 = null; + private JSplitPane jSplitPaneVertical = null; /** - * + * Panel containing the history table. */ - private JPanel jPanel = null; + private JPanel jPanelHistory = null; /** - * + * Panel containing the control buttons for the relay. (left and right) */ - private JPanel jPanel1 = null; + private JPanel jPanelButtonBar = null; /** - * + * Panel containing the control buttons for the relay. (middle) */ - private JPanel jPanel2 = null; + private JPanel jPanelToggleButtonBar = null; /** - * + * This table displays the history. */ - private JTable jTable = null; + private JTable jTableHistory = null; /** - * + * Scroll pane for history. */ - private JScrollPane jScrollPane = null; + private JScrollPane jScrollPaneTableHistory = null; /** - * + * Table model for History. */ - private HistoryTableModel myTableModel; + private HistoryTableModel myHistoryTableModel; /** - * + * About dialog. */ - private AboutDialog aboutDialog; + private AboutDialog myAboutDialog; /** - * + * Toggle button for starting and stopping the relay. */ - private JToggleButton jToggleButton = null; + private JToggleButton jToggleButtonRelay = null; /** - * + * Current state of the relay. */ - private Boolean relayActive = false; + private Boolean myRelayIsActive = false; /** - * + * Toggle button for controlling the auto mode. */ - private JToggleButton jToggleButton1 = null; + private JToggleButton jToggleButtonAutomode = null; /** - * + * Plugin manager. */ - private PluginManager pluginManager = null; + private PluginManager myPluginManager = null; /** * Action: Exit program. @@ -299,7 +297,7 @@ }; /** - * Action: TODO: description. + * Action: Send data to the server. */ private Action sendToServerAction = new AbstractAction() { static final long serialVersionUID = 1L; @@ -310,14 +308,13 @@ } public void actionPerformed(ActionEvent e) { - updateMessages(jTextPaneClientRaw.getText(), true); - controller.writeToServer(jTextPaneClientRaw.getText()); + myController.writeToServer(jTextPaneClientRaw.getText()); jTextPaneClientRaw.setText(""); } }; /** - * Action: TODO: description. + * Action: Send data to the client. */ private Action sendToClientAction = new AbstractAction() { static final long serialVersionUID = 1L; @@ -328,14 +325,13 @@ } public void actionPerformed(ActionEvent e) { - updateMessages(jTextPaneServerRaw.getText(), false); - controller.writeToClient(jTextPaneServerRaw.getText()); + myController.writeToClient(jTextPaneServerRaw.getText()); jTextPaneServerRaw.setText(""); } }; /** - * Action: TODO: description. + * Action: Open configuration dialog. */ private Action configureAction = new AbstractAction() { static final long serialVersionUID = 1L; @@ -346,15 +342,15 @@ } public void actionPerformed(ActionEvent e) { - if (configDialog == null) { - configDialog = new ConfigurationDialog(jFrame); + if (myConfigDialog == null) { + myConfigDialog = new ConfigurationDialog(jFrame); } - configDialog.setVisible(true); + myConfigDialog.setVisible(true); } }; /** - * Action: TODO: description. + * Action: Open plugin configuration dialog. */ private Action configurePluginsAction = new AbstractAction() { static final long serialVersionUID = 1L; @@ -365,16 +361,16 @@ } public void actionPerformed(ActionEvent e) { - if (pluginConfigDialog == null) { - pluginConfigDialog = new PluginConfigurationDialog(jFrame); + if (myPluginConfigurationDialog == null) { + myPluginConfigurationDialog = new PluginConfigurationDialog(jFrame, myPluginManager); } - pluginConfigDialog.addPlugins(pluginManager.getAvailablePlugins()); - pluginConfigDialog.setVisible(true); + myPluginConfigurationDialog.addPlugins(myPluginManager.getAvailablePlugins()); + myPluginConfigurationDialog.setVisible(true); } }; /** - * Action: TODO: description. + * Action: Open about dialog. */ private Action aboutAction = new AbstractAction() { static final long serialVersionUID = 1L; @@ -385,15 +381,15 @@ } public void actionPerformed(ActionEvent e) { - if (aboutDialog == null) { - aboutDialog = new AboutDialog(jFrame); + if (myAboutDialog == null) { + myAboutDialog = new AboutDialog(jFrame); } - aboutDialog.setVisible(true); + myAboutDialog.setVisible(true); } }; /** - * Action: TODO: description. + * Action: Start or stop the relay. */ private Action relayAction = new AbstractAction() { static final long serialVersionUID = 1L; @@ -405,26 +401,26 @@ public void actionPerformed(ActionEvent e) { - if (relayActive) { + if (myRelayIsActive) { putValue(Action.NAME, "Start Relay"); putValue(Action.SHORT_DESCRIPTION, "Start the relay."); putValue(Action.SMALL_ICON, UIResource.getIcon(UIResource.ICON_START)); // TODO: Move to ctrl - relayActive = false; - controller.stopRelay(); + myRelayIsActive = false; + myController.stopRelay(); } else { putValue(Action.NAME, "Stop Relay"); putValue(Action.SHORT_DESCRIPTION, "Stop the relay."); putValue(Action.SMALL_ICON, UIResource.getIcon(UIResource.ICON_STOP)); // TODO: Move to ctrl - controller.startRelay(); - relayActive = true; + myController.startRelay(); + myRelayIsActive = true; } } }; /** - * Action: TODO: description. + * Action: Clear content of left raw pane. */ private Action clearLeftAction = new AbstractAction() { static final long serialVersionUID = 1L; @@ -440,7 +436,7 @@ }; /** - * Action: TODO: description. + * Action: Clear content of right raw pane. */ private Action clearRightAction = new AbstractAction() { static final long serialVersionUID = 1L; @@ -456,7 +452,7 @@ }; /** - * Action: TODO: description. + * Action: Clear content of both raw panes. */ private Action clearAllAction = new AbstractAction() { static final long serialVersionUID = 1L; @@ -473,7 +469,7 @@ }; /** - * Action: TODO: description. + * Action: Enable or disable automode. */ private Action automodeAction = new AbstractAction() { static final long serialVersionUID = 1L; @@ -489,22 +485,24 @@ }; /** - * TODO: wues_ha: enter comment! - * @param ctrl MainControllerInterface - * @param model RelayModelInterface + * Constructor of MainView. Initializes the GUI elements, + * loads the plugins and registers listeners. + * + * @param controller MainControllerInterface + * @param relay RelayModelInterface */ - public MainView(IMainController ctrl, IRelayModel model) { + public MainView(IMainController controller, IRelayModel relay) { Util.setUIDesign(); - relay = model; - controller = ctrl; + myRelay = relay; + myController = controller; + + myRelay.getMessageHistory().addNewMessageListener(this); + myRelay.getMessageHistory().addRefreshMessageListener(this); - relay.registerClientListener((IClientListener) this); - relay.registerServerListener((IServerListener) this); + myPluginManager = PluginManager.getInstance(); + myPluginManager.loadAllPlugins(); - pluginManager = PluginManager.getInstance(); - pluginManager.loadAllPlugins(); - jFrame = getJFrame(); jFrame.pack(); jFrame.setVisible(true); @@ -513,28 +511,6 @@ } /** - * {@inheritDoc} - * - * @see de.dlr.DAVInspector.Relay.IClientListener#updateClient(java.lang.String) - */ - public void updateClient(String data) { -// System.out.println("CU " + data); - jTextPaneClientRaw.setText(data); - updateMessages(data, false); - } - - /** - * {@inheritDoc} - * - * @see de.dlr.DAVInspector.Relay.IServerListener#updateServer(java.lang.String) - */ - public void updateServer(String data) { -// System.out.println("SU " + data); - jTextPaneServerRaw.setText(data); - updateMessages(data, true); - } - - /** * This method initializes jFrame. * * @return javax.swing.JFrame @@ -542,7 +518,6 @@ private JFrame getJFrame() { if (jFrame == null) { jFrame = new JFrame(); - // jFrame.setIconImage(createImageIcon("icons/davinspector.gif", "")); jFrame.setSize(new Dimension(Constant.UI_MAIN_WINDOW_WIDTH, Constant.UI_MAIN_WINDOW_HEIGHT)); jFrame.setContentPane(getJContentPane()); jFrame.setJMenuBar(getJJMenuBar()); @@ -550,7 +525,6 @@ jFrame.setIconImage(UIResource.getIcon(UIResource.ICON_APP32).getImage()); jFrame.addWindowListener(new java.awt.event.WindowAdapter() { - public void windowOpened(java.awt.event.WindowEvent e) { // windowOpened() } @@ -564,8 +538,6 @@ return jFrame; } - - /** * This method initializes jContentPane. * @@ -576,12 +548,12 @@ jContentPane = new JPanel(); jContentPane.setLayout(new BorderLayout()); jContentPane.setPreferredSize(new Dimension(Constant.UI_MAIN_WINDOW_WIDTH, Constant.UI_MAIN_WINDOW_HEIGHT)); - jContentPane.add(getJSplitPane1(), BorderLayout.CENTER); - jContentPane.add(getJPanel1(), BorderLayout.NORTH); + jContentPane.add(getJSplitPaneVertical(), BorderLayout.CENTER); + jContentPane.add(getJPanelButtonBar(), BorderLayout.NORTH); jContentPane.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent e) { - //resize - jSplitPane.setDividerLocation(DIVIDER_HORZ); + // resize + jSplitPaneHorizontal.setDividerLocation(DIVIDER_HORZ); } }); } @@ -589,131 +561,56 @@ } /** - * This method initializes jSplitPane. + * {@inheritDoc} * - * @return javax.swing.JSplitPane + * @see de.dlr.davinspector.history.INewMessageListener#newMessage(de.dlr.davinspector.history.MessageEvent) */ - private JSplitPane getJSplitPane() { - if (jSplitPane == null) { - jSplitPane = new JSplitPane(); - jSplitPane.setLeftComponent(getJTabbedPaneClient()); - jSplitPane.setRightComponent(getJTabbedPaneServer()); - jSplitPane.setDividerLocation(DIVIDER_HORZ); - } - return jSplitPane; + public void newMessage(MessageEvent newMessageEvent) { + Message msg = newMessageEvent.getMessage(); + updateMessage(msg); } - + /** - * This method initializes jButton. + * {@inheritDoc} * - * @return javax.swing.JButton + * @see de.dlr.davinspector.history.IRefreshMessageListener#refreshMessage(de.dlr.davinspector.history.MessageEvent) */ - private JButton getJButtonSendToServer() { - if (jBtnSendToServer == null) { - jBtnSendToServer = new JButton(sendToServerAction); - jBtnSendToServer.setHorizontalTextPosition(AbstractButton.LEADING); - } - return jBtnSendToServer; + public void refreshMessage(MessageEvent refreshMessageEvent) { + Message msg = refreshMessageEvent.getMessage(); + updateMessage(msg); } /** - * This method initializes jJMenuBar. - * - * @return javax.swing.JMenuBar + * This method refreshes the content of the raw views and the loaded plugins. + * + * @param message Message */ - private JMenuBar getJJMenuBar() { - if (jJMenuBar == null) { - jJMenuBar = new JMenuBar(); - jJMenuBar.add(getJMenu()); - jJMenuBar.add(getJMenu1()); - jJMenuBar.add(getJMenu3()); - jJMenuBar.add(getJMenu2()); - } - return jJMenuBar; + private void updateMessage(Message message) { + if (message.getMessageType().equals(Message.MessageType.Request)) { + jTextPaneClientRaw.setText(message.getData()); + myPluginManager.updateActivePluginsClient(message); + } else { + jTextPaneServerRaw.setText(message.getData()); + myPluginManager.updateActivePluginsServer(message); + } } /** - * This method initializes jMenu. + * This method initializes jBtnSendToServer. * - * @return javax.swing.JMenu + * @return javax.swing.JButton */ - private JMenu getJMenu() { - if (jMenu == null) { - jMenu = new JMenu(); - jMenu.setText("File"); - jMenu.setMnemonic(KeyEvent.VK_F); - jMenu.add(getJMenuItem4()); - jMenu.add(getJMenuItem()); + private JButton getJButtonSendToServer() { + if (jBtnSendToServer == null) { + jBtnSendToServer = new JButton(sendToServerAction); + jBtnSendToServer.setHorizontalTextPosition(AbstractButton.LEADING); } - return jMenu; + return jBtnSendToServer; } - + /** - * This method initializes jMenuItem. + * This method initializes jBtnSendToClient. * - * @return javax.swing.JMenuItem - */ - private JMenuItem getJMenuItem() { - if (jMenuItem == null) { - jMenuItem = new JMenuItem(); - jMenuItem.setAction(exitAction); - } - return jMenuItem; - } - - /** - * This method initializes jMenu1. - * - * @return javax.swing.JMenu - */ - private JMenu getJMenu1() { - if (jMenu1 == null) { - jMenu1 = new JMenu(); - jMenu1.setText("View"); - jMenu1.setMnemonic(KeyEvent.VK_V); - jMenu1.add(getJMenuItem1()); - jMenu1.add(getJMenuItem2()); - jMenu1.add(getJMenuItem3()); - } - return jMenu1; - } - - /** - * TODO: wues_ha: Enter comment! - * - * @param data Data - * @param tC Boolean Client to Server - */ - private void updateMessages(String data, Boolean tC) { - // store Message - - // update history table - //myTableModel.addRow(new Object[]{msg.getClientToSever(), msg.getId(), msg.getTimestamp(), msg.getSize()}); - //myTableModel.fireTableDataChanged(); - - //update plugins - List<IPlugin> plugged = pluginManager.getAvailablePlugins(); - for (Iterator<IPlugin> iterator = plugged.iterator(); iterator.hasNext();) { - IPlugin plugin = (IPlugin) iterator.next(); - plugin.update(data); - } - } - - /** - * This method initializes jMenuItem1. - * - * @return javax.swing.JMenuItem - */ - private JMenuItem getJMenuItem1() { - if (jMenuItem1 == null) { - jMenuItem1 = new JMenuItem(clearAllAction); - } - return jMenuItem1; - } - - /** - * This method initializes jButton1. - * * @return javax.swing.JButton */ private JButton getJButtonSendToClient() { @@ -725,414 +622,416 @@ } /** - * This method initializes jMenuItem2. + * This method initializes jTextPaneClientRaw. * - * @return javax.swing.JMenuItem + * @return javax.swing.JTextPane */ - private JMenuItem getJMenuItem2() { - if (jMenuItem2 == null) { - jMenuItem2 = new JMenuItem(clearLeftAction); + private JTextPane getJTextPaneClientRaw() { + if (jTextPaneClientRaw == null) { + jTextPaneClientRaw = new JTextPane(); + jTextPaneClientRaw.setText(""); + jTextPaneClientRaw.setEditable(true); + jTextPaneClientRaw.setBackground(SystemColor.info); } - return jMenuItem2; + return jTextPaneClientRaw; } - /** - * This method initializes jMenuItem3. + /** + * This method initializes jTabbedPaneClient. * - * @return javax.swing.JMenuItem + * @return javax.swing.JTabbedPane */ - private JMenuItem getJMenuItem3() { - if (jMenuItem3 == null) { - jMenuItem3 = new JMenuItem(clearRightAction); + private JTabbedPane getJTabbedPaneClient() { + if (jTabbedPaneClient == null) { + jTabbedPaneClient = new JTabbedPane(); + jTabbedPaneClient.addTab("Raw", null, getJScrollPaneClientRaw(), null); + + //update plugins + if (myPluginManager != null) { + List<IPlugin> plugged = myPluginManager.getActivePluginsClient(); + for (Iterator<IPlugin> iterator = plugged.iterator(); iterator.hasNext();) { + IPlugin plugin = (IPlugin) iterator.next(); + IViewPlugin viewPlugin = (IViewPlugin) plugin; + JScrollPane jScrollPane = new JScrollPane(); + jScrollPane.setViewportView(viewPlugin.getUI()); + jTabbedPaneClient.addTab(viewPlugin.getName(), null, jScrollPane, null); + } + } } - return jMenuItem3; + return jTabbedPaneClient; } /** - * TODO: wues_ha: Enter comment! + * This method initializes jScrollPaneClientRaw. * - * @return String Body of the message + * @return javax.swing.JScrollPane */ - public String getClientBody() { - return clientBody; + private JScrollPane getJScrollPaneClientRaw() { + if (jScrollPaneClientRaw == null) { + jScrollPaneClientRaw = new JScrollPane(); + jScrollPaneClientRaw.setVisible(false); + jScrollPaneClientRaw.setViewportView(getJTextPaneClientRaw()); + } + return jScrollPaneClientRaw; } /** - * TODO: wues_ha: Enter comment! + * This method initializes jTabbedPaneServer. * - * @return String Header of the message + * @return javax.swing.JTabbedPane. */ - public String getClientHeader() { - return clientHeader; - } + private JTabbedPane getJTabbedPaneServer() { + if (jTabbedPaneServer == null) { + jTabbedPaneServer = new JTabbedPane(); + jTabbedPaneServer.addTab("Raw", null, getJScrollPaneServerRaw(), null); - /** - * TODO: wues_ha: Enter comment! - * - * @return String Body of the message - */ - public String getServerBody() { - return serverBody; + //update plugins + if (myPluginManager != null) { + List<IPlugin> plugged = myPluginManager.getActivePluginsServer(); + for (Iterator<IPlugin> iterator = plugged.iterator(); iterator.hasNext();) { + IPlugin plugin = (IPlugin) iterator.next(); + IViewPlugin viewPlugin = (IViewPlugin) plugin; + JScrollPane jScrollPane = new JScrollPane(); + jScrollPane.setViewportView(viewPlugin.getUI()); + jTabbedPaneServer.addTab(viewPlugin.getName(), null, jScrollPane, null); + } + } + } + return jTabbedPaneServer; } /** - * TODO: wues_ha: Enter comment! + * This method initializes getJScrollPaneServerRaw. * - * @return String Header of the message + * @return javax.swing.JScrollPane */ - public String getServerHeader() { - return serverHeader; + private JScrollPane getJScrollPaneServerRaw() { + if (jScrollPaneServerRaw == null) { + jScrollPaneServerRaw = new JScrollPane(); + jScrollPaneServerRaw.setViewportView(getJTextPaneServerRaw()); + } + return jScrollPaneServerRaw; } /** - * TODO: wues_ha: Enter comment! + * This method initializes jTextPaneServerRaw. * - * @param raw String raw input + * @return javax.swing.JTextPane */ - public void setRawInputClient(String raw) { - clientBody = getBody(raw); - clientHeader = getHeader(raw); - /* - if (containsBody(raw)) { - clientBody = getBody(raw); - clientHeader = getHeader(raw); - } else { - clientBody = ""; - clientHeader = raw; + private JTextPane getJTextPaneServerRaw() { + if (jTextPaneServerRaw == null) { + jTextPaneServerRaw = new JTextPane(); + jTextPaneServerRaw.setBackground(SystemColor.info); } - */ + return jTextPaneServerRaw; } /** - * TODO: wues_ha: Enter comment! + * This method initializes jJMenuBar. * - * @param raw String raw input + * @return javax.swing.JMenuBar */ - public void setRawInputServer(String raw) { - serverBody = getBody(raw); - serverHeader = getHeader(raw); + private JMenuBar getJJMenuBar() { + if (jJMenuBar == null) { + jJMenuBar = new JMenuBar(); + jJMenuBar.add(getJMenuFile()); + jJMenuBar.add(getJMenuView()); + jJMenuBar.add(getJMenuPlugins()); + jJMenuBar.add(getJMenuHelp()); + } + return jJMenuBar; } /** - * TODO: wues_ha: Enter comment! + * This method initializes jMenuFile. * - * @param input String containig http packet - * @return String with body + * @return javax.swing.JMenu */ - private String getBody(String input) { - String result = ""; - - // HTTP/1.1 HTTP/1.0 HTTP/0.9 - // TODO: split input into different HTTP messages - //String[] httpMessages = input.split("HTTP/[1.1|1.0|0.9]{1}"); - - // TODO: nur die erste Nachricht wird angezeigt - //input = httpMessages[0]; - - String[] s = input.split("\r\n\r\n"); - for (int i = 1; i < s.length; i++) { - result = s[i]; + private JMenu getJMenuFile() { + if (jMenuFile == null) { + jMenuFile = new JMenu(); + jMenuFile.setText("File"); + jMenuFile.setMnemonic(KeyEvent.VK_F); + jMenuFile.add(getJMenuItemConfigure()); + jMenuFile.add(getJMenuItemExit()); } - - - // detect and process chunked data - // split the input in the different chunks. - // each chunk starts with the length of the chunk in hex. - String[] lines = result.split("(\r\n[0-9a-fA-F]+\r\n)"); - result = ""; - for (int i = 0; i < lines.length; i++) { - result += lines[i]; - } - - return result; + return jMenuFile; } /** - * TODO: wues_ha: Enter comment! + * This method initializes jMenuItemExit. * - * @param input String containing http packet - * @return String with headers + * @return javax.swing.JMenuItem */ - private String getHeader(String input) { - String[] s = input.split("\r\n\r\n"); - return s[0]; + private JMenuItem getJMenuItemExit() { + if (jMenuItemExit == null) { + jMenuItemExit = new JMenuItem(); + jMenuItemExit.setAction(exitAction); + } + return jMenuItemExit; } /** - * This method initializes jTextPane. + * This method initializes jMenuView. * - * @return javax.swing.JTextPane + * @return javax.swing.JMenu */ - private JTextPane getJTextPaneClientRaw() { - if (jTextPaneClientRaw == null) { - jTextPaneClientRaw = new JTextPane(); - jTextPaneClientRaw.setText(""); - jTextPaneClientRaw.setEditable(true); - jTextPaneClientRaw.setBackground(SystemColor.info); + private JMenu getJMenuView() { + if (jMenuView == null) { + jMenuView = new JMenu(); + jMenuView.setText("View"); + jMenuView.setMnemonic(KeyEvent.VK_V); + jMenuView.add(getJMenuItemClearAll()); + jMenuView.add(getJMenuItemClearLeft()); + jMenuView.add(getJMenuItemClearRight()); } - return jTextPaneClientRaw; + return jMenuView; } - /** - * This method initializes jTabbedPane1. - * - * @return javax.swing.JTabbedPane - */ - private JTabbedPane getJTabbedPaneClient() { - if (jTabbedPaneClient == null) { - jTabbedPaneClient = new JTabbedPane(); - jTabbedPaneClient.addTab("Raw", null, getJScrollPaneClientRaw(), null); - - //update plugins - // TODO: load only chosen plugins - if (pluginManager != null) { - List<IPlugin> plugged = pluginManager.getAvailablePlugins(); - for (Iterator<IPlugin> iterator = plugged.iterator(); iterator.hasNext();) { - IPlugin plugin = (IPlugin) iterator.next(); - if (plugin.getType() == PlugInType.VIEW_GENERAL || plugin.getType() == PlugInType.VIEW_CLIENT) { - IViewPlugin viewPlugin = (IViewPlugin) plugin; - JScrollPane jSP = new JScrollPane(); - jSP.setViewportView(viewPlugin.getUI()); - jTabbedPaneClient.addTab(viewPlugin.getName(), null, jSP, null); - } - } - } - } - return jTabbedPaneClient; - } - /** - * This method initializes jScrollPane. + * This method initializes jMenuItemClearAll. * - * @return javax.swing.JScrollPane + * @return javax.swing.JMenuItem */ - private JScrollPane getJScrollPaneClientRaw() { - if (jScrollPaneClientRaw == null) { - jScrollPaneClientRaw = new JScrollPane(); - jScrollPaneClientRaw.setVisible(false); - jScrollPaneClientRaw.setViewportView(getJTextPaneClientRaw()); + private JMenuItem getJMenuItemClearAll() { + if (jMenuItemClearAll == null) { + jMenuItemClearAll = new JMenuItem(clearAllAction); } - return jScrollPaneClientRaw; + return jMenuItemClearAll; } /** - * This method initializes jMenu2. + * This method initializes jMenuItemClearLeft. * - * @return javax.swing.JMenu + * @return javax.swing.JMenuItem */ - private JMenu getJMenu2() { - if (jMenu2 == null) { - jMenu2 = new JMenu(); - jMenu2.setText("Help"); - jMenu2.setMnemonic(KeyEvent.VK_HELP); - jMenu2.add(getJMenuItem5()); + private JMenuItem getJMenuItemClearLeft() { + if (jMenuItemClearLeft == null) { + jMenuItemClearLeft = new JMenuItem(clearLeftAction); } - return jMenu2; + return jMenuItemClearLeft; } /** - * This method initializes jMenuItem4. + * This method initializes jMenuItemClearRight. * * @return javax.swing.JMenuItem */ - private JMenuItem getJMenuItem4() { - if (jMenuItem4 == null) { - jMenuItem4 = new JMenuItem(configureAction); + private JMenuItem getJMenuItemClearRight() { + if (jMenuItemClearRight == null) { + jMenuItemClearRight = new JMenuItem(clearRightAction); } - return jMenuItem4; + return jMenuItemClearRight; } /** - * This method initializes jTabbedPane. + * This method initializes jMenuHelp. * - * @return javax.swing.JTabbedPane. + * @return javax.swing.JMenu */ - private JTabbedPane getJTabbedPaneServer() { - if (jTabbedPaneServer == null) { - jTabbedPaneServer = new JTabbedPane(); - jTabbedPaneServer.addTab("Raw", null, getJScrollPaneServerRaw(), null); + private JMenu getJMenuHelp() { + if (jMenuHelp == null) { + jMenuHelp = new JMenu(); + jMenuHelp.setText("Help"); + jMenuHelp.setMnemonic(KeyEvent.VK_HELP); + jMenuHelp.add(getJMenuItemAbout()); } - return jTabbedPaneServer; + return jMenuHelp; } /** - * This method initializes jScrollPane1. + * This method initializes jMenuItemConfigure. * - * @return javax.swing.JScrollPane + * @return javax.swing.JMenuItem */ - private JScrollPane getJScrollPaneServerRaw() { - if (getJScrollPaneServerRaw == null) { - getJScrollPaneServerRaw = new JScrollPane(); - getJScrollPaneServerRaw.setViewportView(getJTextPaneServerRaw()); + private JMenuItem getJMenuItemConfigure() { + if (jMenuItemConfigure == null) { + jMenuItemConfigure = new JMenuItem(configureAction); } - return getJScrollPaneServerRaw; + return jMenuItemConfigure; } /** - * This method initializes jTextPane1. + * This method initializes jMenuItemAbout. * - * @return javax.swing.JTextPane + * @return javax.swing.JMenuItem */ - private JTextPane getJTextPaneServerRaw() { - if (jTextPaneServerRaw == null) { - jTextPaneServerRaw = new JTextPane(); - jTextPaneServerRaw.setBackground(SystemColor.info); + private JMenuItem getJMenuItemAbout() { + if (jMenuItemAbout == null) { + jMenuItemAbout = new JMenuItem(aboutAction); } - return jTextPaneServerRaw; + return jMenuItemAbout; } /** - * This method initializes jMenuItem5. + * This method initializes jMenuPlugins. * - * @return javax.swing.JMenuItem + * @return javax.swing.JMenu */ - private JMenuItem getJMenuItem5() { - if (jMenuItem5 == null) { - jMenuItem5 = new JMenuItem(aboutAction); + private JMenu getJMenuPlugins() { + if (jMenuPlugins == null) { + jMenuPlugins = new JMenu(); + jMenuPlugins.setText("Plugins"); + jMenuPlugins.add(getJMenuItemConfigurePlugins()); } - return jMenuItem5; + return jMenuPlugins; } /** - * This method initializes jMenu3. + * This method initializes jMenuItemConfigurePlugins. * - * @return javax.swing.JMenu + * @return javax.swing.JMenuItem. */ - private JMenu getJMenu3() { - if (jMenu3 == null) { - jMenu3 = new JMenu(); - jMenu3.setText("Plugins"); - jMenu3.add(getJMenuItem6()); + private JMenuItem getJMenuItemConfigurePlugins() { + if (jMenuItemConfigurePlugins == null) { + jMenuItemConfigurePlugins = new JMenuItem(configurePluginsAction); } - return jMenu3; + return jMenuItemConfigurePlugins; } /** - * This method initializes jMenuItem6. + * This method initializes jSplitPaneHorizontal. * - * @return javax.swing.JMenuItem. + * @return javax.swing.JSplitPane */ - private JMenuItem getJMenuItem6() { - if (jMenuItem6 == null) { - jMenuItem6 = new JMenuItem(configurePluginsAction); + private JSplitPane getJSplitPaneHorizontal() { + if (jSplitPaneHorizontal == null) { + jSplitPaneHorizontal = new JSplitPane(); + jSplitPaneHorizontal.setLeftComponent(getJTabbedPaneClient()); + jSplitPaneHorizontal.setRightComponent(getJTabbedPaneServer()); + jSplitPaneHorizontal.setDividerLocation(DIVIDER_HORZ); } - return jMenuItem6; + return jSplitPaneHorizontal; } /** - * This method initializes jSplitPane1. + * This method initializes jSplitPaneVertical. * * @return javax.swing.JSplitPane */ - private JSplitPane getJSplitPane1() { - if (jSplitPane1 == null) { - jSplitPane1 = new JSplitPane(); - jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT); - jSplitPane1.setDividerLocation(DIVIDER_VERT); - jSplitPane1.setBottomComponent(getJPanel()); - jSplitPane1.setTopComponent(getJSplitPane()); + private JSplitPane getJSplitPaneVertical() { + if (jSplitPaneVertical == null) { + jSplitPaneVertical = new JSplitPane(); + jSplitPaneVertical.setOrientation(JSplitPane.VERTICAL_SPLIT); + jSplitPaneVertical.setDividerLocation(DIVIDER_VERT); + jSplitPaneVertical.setBottomComponent(getJPanelHistory()); + jSplitPaneVertical.setTopComponent(getJSplitPaneHorizontal()); } - return jSplitPane1; + return jSplitPaneVertical; } /** - * This method initializes jPanel. + * This method initializes jPanelHistory. * * @return javax.swing.JPanel */ - private JPanel getJPanel() { - if (jPanel == null) { - jPanel = new JPanel(); - jPanel.setLayout(new BorderLayout()); - jPanel.add(getJScrollPane(), BorderLayout.CENTER); + private JPanel getJPanelHistory() { + if (jPanelHistory == null) { + jPanelHistory = new JPanel(); + jPanelHistory.setLayout(new BorderLayout()); + jPanelHistory.add(getJScrollPaneTableHistory(), BorderLayout.CENTER); } - return jPanel; + return jPanelHistory; } /** - * This method initializes jPanel1. + * This method initializes jPanelButtonBar. * * @return javax.swing.JPanel */ - private JPanel getJPanel1() { - if (jPanel1 == null) { - jPanel1 = new JPanel(); - jPanel1.setLayout(new BorderLayout()); - jPanel1.add(getJButtonSendToServer(), BorderLayout.WEST); - jPanel1.add(getJPanel2(), BorderLayout.CENTER); - jPanel1.add(getJButtonSendToClient(), BorderLayout.EAST); + private JPanel getJPanelButtonBar() { + if (jPanelButtonBar == null) { + jPanelButtonBar = new JPanel(); + jPanelButtonBar.setLayout(new BorderLayout()); + jPanelButtonBar.add(getJButtonSendToServer(), BorderLayout.WEST); + jPanelButtonBar.add(getJPanelToggleButtonBar(), BorderLayout.CENTER); + jPanelButtonBar.add(getJButtonSendToClient(), BorderLayout.EAST); } - return jPanel1; + return jPanelButtonBar; } /** - * This method initializes jPanel2. + * This method initializes jPanelToggleButtonBar. * * @return javax.swing.JPanel */ - private JPanel getJPanel2() { - if (jPanel2 == null) { - jPanel2 = new JPanel(); - jPanel2.setLayout(new GridBagLayout()); - jPanel2.add(getJToggleButton()); - jPanel2.add(getJToggleButton1(), null); + private JPanel getJPanelToggleButtonBar() { + if (jPanelToggleButtonBar == null) { + jPanelToggleButtonBar = new JPanel(); + jPanelToggleButtonBar.setLayout(new GridBagLayout()); + jPanelToggleButtonBar.add(getJToggleButtonRelay()); + jPanelToggleButtonBar.add(getJToggleButtonAutomode(), null); } - return jPanel2; + return jPanelToggleButtonBar; } /** - * This method initializes jTable. + * This method initializes jTableHistory. * * @return javax.swing.JTable */ - private JTable getJTable() { + private JTable getJTableHistory() { - if (jTable == null) { - myTableModel = new HistoryTableModel(); + if (jTableHistory == null) { + myHistoryTableModel = new HistoryTableModel(); + // TODO: getMessageHistory restructure model/relay + myRelay.getMessageHistory().addNewMessageListener(myHistoryTableModel); - jTable = new JTable(myTableModel); - jTable.setShowGrid(true); - jTable.setAutoCreateRowSorter(true); + jTableHistory = new JTable(myHistoryTableModel); + jTableHistory.setShowGrid(true); + jTableHistory.setAutoCreateRowSorter(true); + jTableHistory.getSelectionModel().addListSelectionListener(new ListSelectionListener() { + public void valueChanged(ListSelectionEvent event) { + if (event.getValueIsAdjusting()) { + return; + } + int rowIndex = jTableHistory.getSelectedRow(); + if (rowIndex >= 0 && rowIndex < jTableHistory.getRowCount()) { + int id = (Integer) jTableHistory.getValueAt(rowIndex, 1); + myRelay.getMessageHistory().loadMessageByID(id); + } + } + }); - jTable.setDefaultRenderer(Object.class, new HistoryTableCellRenderer()); + jTableHistory.setDefaultRenderer(Object.class, new HistoryTableCellRenderer()); } - return jTable; + return jTableHistory; } /** - * This method initializes jScrollPane. + * This method initializes jScrollPaneTableHistory. * * @return javax.swing.JScrollPane */ - private JScrollPane getJScrollPane() { - if (jScrollPane == null) { - jScrollPane = new JScrollPane(); - jScrollPane.setViewportView(getJTable()); + private JScrollPane getJScrollPaneTableHistory() { + if (jScrollPaneTableHistory == null) { + jScrollPaneTableHistory = new JScrollPane(); + jScrollPaneTableHistory.setViewportView(getJTableHistory()); } - return jScrollPane; + return jScrollPaneTableHistory; } /** - * This method initializes jToggleButton. + * This method initializes jToggleButtonRelay. * * @return javax.swing.JToggleButton */ - private JToggleButton getJToggleButton() { - if (jToggleButton == null) { - jToggleButton = new JToggleButton(relayAction); + private JToggleButton getJToggleButtonRelay() { + if (jToggleButtonRelay == null) { + jToggleButtonRelay = new JToggleButton(relayAction); } - return jToggleButton; + return jToggleButtonRelay; } /** - * This method initializes jToggleButton1. + * This method initializes jToggleButtonAutomode. * * @return javax.swing.JToggleButton */ - private JToggleButton getJToggleButton1() { - if (jToggleButton1 == null) { - jToggleButton1 = new JToggleButton(automodeAction); + private JToggleButton getJToggleButtonAutomode() { + if (jToggleButtonAutomode == null) { + jToggleButtonAutomode = new JToggleButton(automodeAction); } - return jToggleButton1; + return jToggleButtonAutomode; } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java 2008-02-21 10:33:17 UTC (rev 52) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java 2008-02-22 12:46:54 UTC (rev 53) @@ -1,7 +1,7 @@ /* * PluginConfigurationDialog.java * - * TODO: wues_ha Enter comment! + * Displays the configuration dialog to configure the plugins. * * Created: 10.01.2008 Jochen Wuest <joc...@dl...> * Changed: @@ -28,7 +28,10 @@ import java.awt.BorderLayout; import java.awt.Frame; import java.awt.Window; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Vector; import javax.swing.JButton; import javax.swing.JDialog; @@ -39,9 +42,10 @@ import de.dlr.davinspector.common.Constant; import de.dlr.davinspector.common.Util; import de.dlr.davinspector.plugin.IPlugin; +import de.dlr.davinspector.plugin.PluginManager; /** - * TODO: wues_ha: Enter comment! + * Displays the configuration dialog to configure the plugins. * * @version $LastChangedRevision$ * @author Jochen Wuest @@ -52,53 +56,92 @@ * */ private static final long serialVersionUID = 1L; + /** * */ private JPanel jContentPane = null; + /** * */ private JScrollPane jScrollPane = null; + /** * */ - private JPanel jPanel1 = null; + private JPanel jPanelButtonBar = null; + /** * */ private JTable jTable = null; + /** * */ - private JButton jButton = null; + private JButton jButtonCancel = null; + /** * */ - private JButton jButton1 = null; + private JButton jButtonOk = null; + + /** + * Stores the availability of a plugin for client and server. + */ + private Map<String, Boolean[]> myAvailablePlugins = new HashMap<String, Boolean[]>(); + + /** + * The plugin manager. + */ + private PluginManager myPluginManager = null; /** - * + * Table model of the plugin configuration table. */ private PluginConfigurationTableModel myTableModel; - + /... [truncated message content] |
From: <wu...@us...> - 2008-02-21 10:33:47
|
Revision: 52 http://davinspector.svn.sourceforge.net/davinspector/?rev=52&view=rev Author: wuest Date: 2008-02-21 02:33:17 -0800 (Thu, 21 Feb 2008) Log Message: ----------- Completed and corrected Comments and package description. Changed update method to handle message objects instead of strings. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/JTreeContentHandler.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreeView.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/package.html Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/JTreeContentHandler.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/JTreeContentHandler.java 2008-02-21 09:37:25 UTC (rev 51) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/JTreeContentHandler.java 2008-02-21 10:33:17 UTC (rev 52) @@ -1,7 +1,8 @@ /* * JTreeContentHandler.java * - * TODO: wues_ha Enter comment! + * JTreeContentHandler implements the SAX ContentHandler interface + * builds up the JTree nodes. * * Created: 11.12.2007 Jochen Wuest <joc...@dl...> * Changed: @@ -38,9 +39,8 @@ import org.xml.sax.SAXException; /** - * JTreeContentHandler implements the SAX ContentHandler - * interface and defines callback behavior for the SAX callbacks associated with an XML document's - * content, bulding up JTree nodes. + * JTreeContentHandler implements the SAX ContentHandler interface + * builds up the JTree nodes. * * @version $LastChangedRevision$ * @author Jochen Wuest @@ -69,45 +69,41 @@ * @param base node to start adding sub-nodes to. */ public JTreeContentHandler(DefaultTreeModel treeModelp, DefaultMutableTreeNode base) { - this.current = base; - this.namespaceMappings = new HashMap<String, String>(); + current = base; + namespaceMappings = new HashMap<String, String>(); } /** - * @param locatorP Locator object tied to callback process. + * {@inheritDoc} + * + * @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator) */ public void setDocumentLocator(Locator locatorP) { // empty } /** - * This indicates the start of a Document parse-this precedes all callbacks in all SAX Handlers - * with the sole exception of setDocumentLocator. - * - * @throws SAXException when things go wrong. + * {@inheritDoc} + * + * @see org.xml.sax.ContentHandler#startDocument() */ public void startDocument() throws SAXException { // No visual events occur here } /** - * This indicates the end of a Document parse-this occurs after all callbacks in all SAX - * Handlers. - * - * @throws SAXException when things go wrong. + * {@inheritDoc} + * + * @see org.xml.sax.ContentHandler#endDocument() */ public void endDocument() throws SAXException { // No visual events occur here } /** - * This indicates that a processing instruction (other than the XML declaration) has been - * encountered. - * - * @param target String target of PI. - * @param data String containing all data sent to the PI. - * This typically looks like one or more attribute value pairs. - * @throws SAXException when things go wrong + * {@inheritDoc} + * + * @see org.xml.sax.ContentHandler#processingInstruction(java.lang.String, java.lang.String) */ public void processingInstruction(String target, String data) throws SAXException { @@ -116,13 +112,9 @@ } /** - * This indicates the beginning of an XML Namespace prefix mapping. Although this typically - * occurs within the root element of an XML document, it can occur at any point within the - * document. Note that a prefix mapping on an element triggers this callback before the - * callback for the actual element itself (startElement) occurs. - * - * @param prefix String prefix used for the namespace being reported. - * @param uri String URI for the namespace being reported. + * {@inheritDoc} + * + * @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String, java.lang.String) */ public void startPrefixMapping(String prefix, String uri) { // No visual events occur here. @@ -130,10 +122,9 @@ } /** - * This indicates the end of a prefix mapping, when the namespace reported in a - * startPrefixMapping callback is no longer available. - * - * @param prefix String of namespace being reported. + * {@inheritDoc} + * + * @see org.xml.sax.ContentHandler#endPrefixMapping(java.lang.String) */ public void endPrefixMapping(String prefix) { // No visual events occur here. @@ -149,17 +140,11 @@ } /** - * This reports the occurrence of an actual element. It includes the element's attributes, with - * the exception of XML vocabulary specific attributes, such as - * xmlns:[namespace prefix] and xsi:schemaLocation. - * - * @param namespaceURI String namespace URI this element is associated with, or an empty String. - * @param localName String name of element (with no namespace prefix, if one is present). - * @param qName String XML 1.0 version of element name: [namespaceprefix]:[localName]. - * @param atts Attributes list for this element. - * @throws SAXException when things go wrong. + * {@inheritDoc} + * + * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) */ - public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { + public void startElement(String namespaceURI, String localName, String qName, Attributes attributes) throws SAXException { DefaultMutableTreeNode element = new DefaultMutableTreeNode("Element: " + localName); current.add(element); @@ -177,11 +162,11 @@ } // Process attributes - for (int i = 0; i < atts.getLength(); i++) { + for (int i = 0; i < attributes.getLength(); i++) { DefaultMutableTreeNode attribute = - new DefaultMutableTreeNode("Attribute (name = '" + atts.getLocalName(i) - + "', value = '" + atts.getValue(i) + "')"); - String attURI = atts.getURI(i); + new DefaultMutableTreeNode("Attribute (name = '" + attributes.getLocalName(i) + + "', value = '" + attributes.getValue(i) + "')"); + String attURI = attributes.getURI(i); if (attURI.length() > 0) { String attPrefix = (String) namespaceMappings.get(namespaceURI); if (attPrefix.equals("")) { @@ -197,28 +182,18 @@ } /** - * Indicates the end of an element is reached. Note - * that the parser does not distinguish between empty elements and non-empty elements, so this - * occurs uniformly. - * - * @param namespaceURI String URI of namespace this element is associated with - * @param localName String name of element without prefix - * @param qName String name of element in XML 1.0 form - * @throws SAXException when things go wrong + * {@inheritDoc} + * + * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, java.lang.String) */ public void endElement(String namespaceURI, String localName, String qName) throws SAXException { - - // Walk back up the tree current = (DefaultMutableTreeNode) current.getParent(); } /** - * This reports character data (within an element). - * - * @param ch char[] character array with character data - * @param start int index in array where data starts. - * @param length int index in array where data ends. - * @throws SAXException when things go wrong + * {@inheritDoc} + * + * @see org.xml.sax.ContentHandler#characters(char[], int, int) */ public void characters(char[] ch, int start, int length) throws SAXException { @@ -228,24 +203,18 @@ } /** - * This reports whitespace that can be ignored in the originating document. This is typically - * invoked only when validation is ocurring in the parsing process. - * - * @param ch char[] character array with character data - * @param start int index in array where data starts. - * @param length int length of data ends. - * @throws SAXException when things go wrong + * {@inheritDoc} + * + * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int) */ public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { // This is ignorable, so don't display it } /** - * This reports an entity that is skipped by the parser. This should only occur for - * non-validating parsers, and then is still implementation-dependent behavior. - * - * @param name String name of entity being skipped - * @throws SAXException when things go wrong + * {@inheritDoc} + * + * @see org.xml.sax.ContentHandler#skippedEntity(java.lang.String) */ public void skippedEntity(String name) throws SAXException { DefaultMutableTreeNode skipped = new DefaultMutableTreeNode("Skipped Entity: '" + name + APOSTROPHE); Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java 2008-02-21 09:37:25 UTC (rev 51) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java 2008-02-21 10:33:17 UTC (rev 52) @@ -1,7 +1,7 @@ /* * XMLTreePlugin.java * - * TODO: wues_ha Enter comment! + * This is the main class of the XML-Tree Plugin. * * Created: 24.01.2008 Jochen Wuest <joc...@dl...> * Changed: @@ -31,25 +31,27 @@ import org.xml.sax.SAXException; +import de.dlr.davinspector.history.Message; import de.dlr.davinspector.plugin.IViewPlugin; /** - * TODO: wues_ha: Enter comment! + * This is the main class of the XML-Tree Plugin. * * @version $LastChangedRevision$ * @author Jochen Wuest */ public class XMLTreePlugin implements IViewPlugin { + /** - * + * State of the plugin. */ - private Boolean active = false; + private Boolean isActive = true; /** - * + * The XMLTree component. */ - private XMLTreeView xmlTreeView; + private XMLTreeView myXMLTreeView; /** * {@inheritDoc} @@ -57,7 +59,7 @@ * @see de.dlr.DAVInspector.Plugin.IViewPlugin#getUI() */ public JComponent getUI() { - return xmlTreeView; + return myXMLTreeView; } /** @@ -111,8 +113,8 @@ * @see de.dlr.DAVInspector.Plugin.IPlugin#init() */ public void init() { - if (xmlTreeView == null) { - xmlTreeView = new XMLTreeView(); + if (myXMLTreeView == null) { + myXMLTreeView = new XMLTreeView(); } updateTree(""); } @@ -123,7 +125,7 @@ * @see de.dlr.DAVInspector.Plugin.IPlugin#isActive() */ public Boolean isActive() { - return active; + return isActive; } /** @@ -132,7 +134,7 @@ * @see de.dlr.DAVInspector.Plugin.IPlugin#setActive(java.lang.Boolean) */ public void setActive(Boolean state) { - active = state; + isActive = state; } /** @@ -140,20 +142,20 @@ * * @see de.dlr.DAVInspector.Plugin.IPlugin#update(java.lang.String) */ - public void update(String data) { - if (active) { - updateTree(data); + public void update(Message msg) { + if (isActive) { + updateTree(msg.getMessageBody()); } } /** - * TODO: wues_ha: Enter comment! + * Inits the tree and starts the XML parsing. * - * @param data String + * @param data String */ private void updateTree(String data) { try { - xmlTreeView.init(data); + myXMLTreeView.init(data); } catch (SAXException se) { System.err.println(se); } catch (IOException ioe) { Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreeView.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreeView.java 2008-02-21 09:37:25 UTC (rev 51) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreeView.java 2008-02-21 10:33:17 UTC (rev 52) @@ -1,7 +1,7 @@ /* * XMLTreeView.java * - * TODO: wues_ha Enter comment! + * This class is an extension of <code>JTree</code> to handle XML content. * * Created: 10.12.2007 Jochen Wuest <joc...@dl...> * Changed: @@ -40,7 +40,7 @@ /** - * TODO: wues_ha: Enter comment! + * This class is an extension of <code>JTree</code> to handle XML content. * * @version $LastChangedRevision$ * @author Jochen Wuest @@ -51,21 +51,23 @@ * */ static final long serialVersionUID = 0; + /** - * + * Data model for the tree. */ - private DefaultTreeModel defaultTreeModel; + private DefaultTreeModel myDefaultTreeModel; /** - * TODO: wues_ha: enter comment! - * + * Constructor, empty. */ public XMLTreeView() { } /** - * TODO: wues_ha: Enter comment! + * This method initializes the tree and the tree data model. + * Afterwards <code>buildTree</code> is called. + * If {@code xmlInput} is empty, a xml root element is added to avoid parsing errors. * * @param xmlInput String XML data to parse. * @throws IOException if IO fails. @@ -81,30 +83,30 @@ DefaultMutableTreeNode base = new DefaultMutableTreeNode("XML Document: " + "Root"); // Build the tree model - defaultTreeModel = new DefaultTreeModel(base); - this.setModel(defaultTreeModel); + myDefaultTreeModel = new DefaultTreeModel(base); + setModel(myDefaultTreeModel); // Construct the tree hierarchy - buildTree(defaultTreeModel, base, xmlInput); + buildTree(myDefaultTreeModel, base, xmlInput); expandAll(); } /** - * TODO: wues_ha: Enter comment! + * This method actually parses the XML data and builds the tree. * - * @param dTreeModel DefaultTreeModel for Tree. - * @param dBase DefaultMutableTreeNode Root element. + * @param treeModel DefaultTreeModel for Tree. + * @param baseNode DefaultMutableTreeNode Root element. * @param xmlInput String XML data to parse. * @throws IOException if IO fails. * @throws SAXException if SAX fails. */ - public void buildTree(DefaultTreeModel dTreeModel, DefaultMutableTreeNode dBase, + private void buildTree(DefaultTreeModel treeModel, DefaultMutableTreeNode baseNode, String xmlInput) throws IOException, SAXException { // Create instances needed for parsing XMLReader reader = XMLReaderFactory.createXMLReader(); - ContentHandler jTreeContentHandler = new JTreeContentHandler(dTreeModel, dBase); + ContentHandler jTreeContentHandler = new JTreeContentHandler(treeModel, baseNode); // Register content handler reader.setContentHandler(jTreeContentHandler); @@ -116,8 +118,7 @@ } /** - * TODO: wues_ha: Enter comment! - * + * This method expands the complete tree. */ public void expandAll() { int row = 0; @@ -128,8 +129,7 @@ } /** - * TODO: wues_ha: Enter comment! - * + * This method collapses all nodes. */ public void collapseAll() { int row = getRowCount() - 1; Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/package.html =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/package.html 2008-02-21 09:37:25 UTC (rev 51) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/package.html 2008-02-21 10:33:17 UTC (rev 52) @@ -1,12 +1,6 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> -<html><head><title>BLUB B</title></head><body> - -BLUB B - -<h2>Package Specification</h2> - -BLUB B - +<html><head><title>XML Tree Plugin</title></head><body> +This package contains all classes needed to display XML content in a JTree. </body></html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-21 09:37:29
|
Revision: 51 http://davinspector.svn.sourceforge.net/davinspector/?rev=51&view=rev Author: wuest Date: 2008-02-21 01:37:25 -0800 (Thu, 21 Feb 2008) Log Message: ----------- Completed Comments and package description. Changed update method to handle message objects instead of strings. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLTextPane.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/package.html Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java 2008-02-20 23:09:44 UTC (rev 50) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java 2008-02-21 09:37:25 UTC (rev 51) @@ -44,7 +44,7 @@ import org.xml.sax.SAXException; /** - * TODO: wues_ha: Enter comment! + * Content handler for SAX-Parser. * * @version $LastChangedRevision$ * @author Jochen Wuest @@ -52,11 +52,12 @@ public class JTextPaneContentHandler implements ContentHandler { /** - * + * Character/s for newline. */ static final String NEWLINE = "\r\n"; + /** - * + * Character/s for indent. */ static final String INDENT = " "; @@ -66,77 +67,80 @@ private Map<String, String> namespaceMappings; /** - * + * The document. */ - private StyledDocument doc; + private StyledDocument myDocument; + /** - * + * The attributes of the document. */ - private AttributeSet as; + private AttributeSet myAttributeSet; + /** - * + * This stores the current nesting level. */ - private int level; + private int myLevel; /** - * + * String buffer for the character data. */ - private String bufferCharacterData; + private String myBufferCharacterData; + /** - * + * String buffer for the end tag. */ - private String bufferEndTag; + private String myBufferEndTag; + /** - * + * String buffer for the start tag. */ - private String bufferStartTag; + private String myBufferStartTag; /** - * TODO: wues_ha: enter comment! + * Constructor, initializes all buffers and sets up the document. * - * @param document - * Object from TextPane. + * @param document StyledDocument */ public JTextPaneContentHandler(StyledDocument document) { - this.namespaceMappings = new HashMap<String, String>(); - this.doc = document; - Element e = doc.getDefaultRootElement(); - as = e.getAttributes(); - level = 0; - bufferCharacterData = ""; - bufferEndTag = ""; - bufferStartTag = ""; + namespaceMappings = new HashMap<String, String>(); + myDocument = document; + Element rootElement = myDocument.getDefaultRootElement(); + myAttributeSet = rootElement.getAttributes(); + myLevel = 0; + myBufferCharacterData = ""; + myBufferEndTag = ""; + myBufferStartTag = ""; addText(Color.magenta, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" + NEWLINE); } /** - * TODO: wues_ha: Enter comment! + * This method adds text in the specified color to the <code>myDocument</code>. * - * @param c Color of the text. + * @param color Color of the text. * @param text String to add to pane. */ - private void addText(Color c, String text) { - StyleContext sc = StyleContext.getDefaultStyleContext(); - AttributeSet aset = sc.addAttribute(SimpleAttributeSet.EMPTY, - StyleConstants.Foreground, c); + private void addText(Color color, String text) { + StyleContext styleContext = StyleContext.getDefaultStyleContext(); + AttributeSet attributeSet = styleContext.addAttribute(SimpleAttributeSet.EMPTY, + StyleConstants.Foreground, color); try { - doc.insertString(doc.getLength(), text, as); + myDocument.insertString(myDocument.getLength(), text, myAttributeSet); } catch (BadLocationException ble) { System.err.println(ble); } - doc.setCharacterAttributes(doc.getLength() - text.length(), text.length(), aset, false); + myDocument.setCharacterAttributes(myDocument.getLength() - text.length(), text.length(), attributeSet, false); } /** - * TODO: wues_ha: Enter comment! + * This method returns the needed indents according to the current branch. * - * @return indents needed. + * @return String */ public String getIndent() { String result = ""; - for (int i = 0; i < level; i++) { + for (int i = 0; i < myLevel; i++) { result += INDENT; } return result; @@ -150,7 +154,7 @@ public void characters(char[] ch, int start, int length) throws SAXException { String s = new String(ch, start, length).trim(); if (s.length() > 0) { - bufferCharacterData += s; + myBufferCharacterData += s; } } @@ -160,16 +164,16 @@ * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, * java.lang.String, org.xml.sax.Attributes) */ - public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { - // if there is a buffered start tag, write to the output - if (!bufferStartTag.trim().isEmpty()) { - level--; - addText(Color.BLUE , getIndent() + bufferStartTag + NEWLINE); - level++; + public void startElement(String namespaceURI, String localName, String qName, Attributes attributes) throws SAXException { + // if there is a buffered start tag, write it to the output + if (!myBufferStartTag.trim().isEmpty()) { + myLevel--; + addText(Color.BLUE , getIndent() + myBufferStartTag + NEWLINE); + myLevel++; } // Determine namespace - // TODO: namespace nur bei bedarf anzeigen - schon in hashmap? + // TODO: display namespace only first time? String prefix = ""; if (namespaceURI.length() > 0) { prefix = (String) namespaceMappings.get(namespaceURI); @@ -179,16 +183,15 @@ prefix = " xmlns:" + prefix + "=\"" + namespaceURI + "\""; } - bufferStartTag = "<" + qName + prefix; + myBufferStartTag = "<" + qName + prefix; - // Attribute ausgeben - for (int i = 0; i < atts.getLength(); i++) { - bufferStartTag += " " + atts.getQName(i) + "=\"" + atts.getValue(i) + "\""; + // display attributes + for (int i = 0; i < attributes.getLength(); i++) { + myBufferStartTag += " " + attributes.getQName(i) + "=\"" + attributes.getValue(i) + "\""; } - bufferStartTag += ">"; - - level++; + myBufferStartTag += ">"; + myLevel++; } /** @@ -198,20 +201,20 @@ * java.lang.String) */ public void endElement(String namespaceURI, String localName, String qName) throws SAXException { - bufferEndTag = "</" + qName + ">"; - level--; + myBufferEndTag = "</" + qName + ">"; + myLevel--; - if (bufferCharacterData.trim().isEmpty()) { - addText(Color.BLUE, getIndent() + bufferStartTag + bufferEndTag + NEWLINE); + if (myBufferCharacterData.trim().isEmpty()) { + addText(Color.BLUE, getIndent() + myBufferStartTag + myBufferEndTag + NEWLINE); } else { - addText(Color.BLUE, getIndent() + bufferStartTag); - addText(Color.BLACK, bufferCharacterData); - addText(Color.BLUE, bufferEndTag + NEWLINE); + addText(Color.BLUE, getIndent() + myBufferStartTag); + addText(Color.BLACK, myBufferCharacterData); + addText(Color.BLUE, myBufferEndTag + NEWLINE); } - bufferCharacterData = ""; - bufferEndTag = ""; - bufferStartTag = ""; + myBufferCharacterData = ""; + myBufferEndTag = ""; + myBufferStartTag = ""; } /** Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java 2008-02-20 23:09:44 UTC (rev 50) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java 2008-02-21 09:37:25 UTC (rev 51) @@ -1,7 +1,7 @@ /* * XMLPlugin.java * - * TODO: wues_ha Enter comment! + * This class contains the XML-View Plugin. * * Created: 22.01.2008 Jochen Wuest <joc...@dl...> * Changed: @@ -25,15 +25,14 @@ package de.dlr.davinspector.plugins.xmlplugin; -import java.awt.SystemColor; - import javax.swing.JComponent; +import de.dlr.davinspector.history.Message; import de.dlr.davinspector.plugin.IViewPlugin; /** - * TODO: wues_ha: Enter comment! + * This class contains the XML-View Plugin. * * @version $LastChangedRevision$ * @author Jochen Wuest @@ -41,14 +40,14 @@ public class XMLPlugin implements IViewPlugin { /** - * + * State of the plugin. */ - private Boolean active = false; + private Boolean isActive = true; /** - * + * The GUI object. */ - private XMLTextPane xmlTextPane; + private XMLTextPane myXMLTextPane; /** * {@inheritDoc} @@ -56,8 +55,7 @@ * @see de.dlr.DAVInspector.Plugin.IViewPlugin#getUI() */ public JComponent getUI() { - // TODO Auto-generated method stub - return xmlTextPane; + return myXMLTextPane; } /** @@ -111,12 +109,11 @@ * @see de.dlr.DAVInspector.Plugin.IPlugin#init() */ public void init() { - if (xmlTextPane == null) { - xmlTextPane = new XMLTextPane(); - xmlTextPane.setEditable(false); - xmlTextPane.setBackground(SystemColor.yellow); + if (myXMLTextPane == null) { + myXMLTextPane = new XMLTextPane(); + myXMLTextPane.setEditable(false); } - xmlTextPane.setText(""); + myXMLTextPane.setText(""); } /** @@ -125,7 +122,7 @@ * @see de.dlr.DAVInspector.Plugin.IPlugin#isActive() */ public Boolean isActive() { - return active; + return isActive; } /** @@ -134,7 +131,7 @@ * @see de.dlr.DAVInspector.Plugin.IPlugin#setActive(java.lang.Boolean) */ public void setActive(Boolean state) { - active = state; + isActive = state; } /** @@ -142,9 +139,9 @@ * * @see de.dlr.DAVInspector.Plugin.IPlugin#update(java.lang.String) */ - public void update(String data) { - if (active) { - xmlTextPane.setText(data); + public void update(Message msg) { + if (isActive) { + myXMLTextPane.setText(msg.getMessageBody()); } } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLTextPane.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLTextPane.java 2008-02-20 23:09:44 UTC (rev 50) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLTextPane.java 2008-02-21 09:37:25 UTC (rev 51) @@ -1,7 +1,7 @@ /* * XMLTextPane.java * - * TODO: wues_ha Enter comment! + * This class is an extension of <code>JTextPane</code> to handle XML content. * * Created: 11.12.2007 Jochen Wuest <joc...@dl...> * Changed: @@ -39,48 +39,47 @@ import org.xml.sax.helpers.XMLReaderFactory; - /** - * TODO: wues_ha: Enter comment! + * This class is an extension of <code>JTextPane</code> to handle XML content. * * @version $LastChangedRevision$ * @author Jochen Wuest */ public class XMLTextPane extends JTextPane { + /** * */ static final long serialVersionUID = 0; /** - * + * The document. */ - private StyledDocument doc; + private StyledDocument myDocument; /** - * TODO: wues_ha: enter comment! - * + * Constructor, empty. */ public XMLTextPane() { } /** - * To achieve no wordwrap. + * To achieve no word wrap. * {@inheritDoc} * * @see java.awt.Component#setSize(java.awt.Dimension) */ - public void setSize(Dimension d) { - if (d.width < getParent().getSize().width) { - d.width = getParent().getSize().width; + public void setSize(Dimension dimension) { + if (dimension.width < getParent().getSize().width) { + dimension.width = getParent().getSize().width; } - super.setSize(d); + super.setSize(dimension); } /** - * To achieve no wordwrap. + * To achieve no word wrap. * {@inheritDoc} * * @see javax.swing.JEditorPane#getScrollableTracksViewportWidth() @@ -90,20 +89,20 @@ } /** - * TODO: wues_ha: Enter comment! + * This method initializes the <code>StyledDocument</code> and starts the XML parser. * - * @param xmlInput XML data to parse. + * @param xmlInput String * @throws IOException if IO fails * @throws SAXException if SAX fails */ public void init(String xmlInput) throws IOException, SAXException { - this.setText(""); - doc = this.getStyledDocument(); + setText(""); + myDocument = getStyledDocument(); if (!xmlInput.trim().equals("")) { // Create instances needed for parsing XMLReader reader = XMLReaderFactory.createXMLReader(); - ContentHandler jTextPaneContentHandler = new JTextPaneContentHandler(doc); + ContentHandler jTextPaneContentHandler = new JTextPaneContentHandler(myDocument); // Register content handler reader.setContentHandler(jTextPaneContentHandler); Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/package.html =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/package.html 2008-02-20 23:09:44 UTC (rev 50) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/package.html 2008-02-21 09:37:25 UTC (rev 51) @@ -1,12 +1,6 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> -<html><head><title>BLUB B</title></head><body> - -BLUB B - -<h2>Package Specification</h2> - -BLUB B - +<html><head><title>XML-Plugin</title></head><body> +This package contains all classes needed to display XML content in a JTextPane. </body></html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kil...@us...> - 2008-02-20 23:09:52
|
Revision: 50 http://davinspector.svn.sourceforge.net/davinspector/?rev=50&view=rev Author: killerjoe Date: 2008-02-20 15:09:44 -0800 (Wed, 20 Feb 2008) Log Message: ----------- Removed sticky JDK 5 @override annotations. Modified Paths: -------------- branches/prototype2/DAVInspector/src/de/dlr/DAVInspector/JTextPaneContentHandler.java branches/prototype2/DAVInspector/src/de/dlr/DAVInspector/plugins/RawPlugin.java Modified: branches/prototype2/DAVInspector/src/de/dlr/DAVInspector/JTextPaneContentHandler.java =================================================================== --- branches/prototype2/DAVInspector/src/de/dlr/DAVInspector/JTextPaneContentHandler.java 2008-02-20 13:25:42 UTC (rev 49) +++ branches/prototype2/DAVInspector/src/de/dlr/DAVInspector/JTextPaneContentHandler.java 2008-02-20 23:09:44 UTC (rev 50) @@ -139,7 +139,6 @@ * * @see org.xml.sax.ContentHandler#characters(char[], int, int) */ - @Override public void characters(char[] ch, int start, int length) throws SAXException { String s = new String(ch, start, length).trim(); if (s.length() > 0) { @@ -153,7 +152,6 @@ * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, * java.lang.String, org.xml.sax.Attributes) */ - @Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { // if there is a buffered start tag, write to the output if (!bufferStartTag.trim().isEmpty()) { @@ -191,7 +189,6 @@ * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, * java.lang.String) */ - @Override public void endElement(String namespaceURI, String localName, String qName) throws SAXException { bufferEndTag = "</" + qName + ">"; level--; @@ -214,7 +211,6 @@ * * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int) */ - @Override public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException { // empty } @@ -224,7 +220,6 @@ * * @see org.xml.sax.ContentHandler#processingInstruction(java.lang.String, java.lang.String) */ - @Override public void processingInstruction(String arg0, String arg1) throws SAXException { // empty } @@ -234,7 +229,6 @@ * * @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator) */ - @Override public void setDocumentLocator(Locator locator) { // empty } @@ -244,7 +238,6 @@ * * @see org.xml.sax.ContentHandler#endDocument() */ - @Override public void endDocument() throws SAXException { // empty } @@ -254,7 +247,6 @@ * * @see org.xml.sax.ContentHandler#startDocument() */ - @Override public void startDocument() throws SAXException { // empty } @@ -264,7 +256,6 @@ * * @see org.xml.sax.ContentHandler#skippedEntity(java.lang.String) */ - @Override public void skippedEntity(String name) throws SAXException { // empty } @@ -279,7 +270,6 @@ * * @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String, java.lang.String) */ - @Override public void startPrefixMapping(String prefix, String uri) throws SAXException { namespaceMappings.put(uri, prefix); } @@ -292,7 +282,6 @@ * * @see org.xml.sax.ContentHandler#endPrefixMapping(java.lang.String) */ - @Override public void endPrefixMapping(String prefix) throws SAXException { for (Iterator<String> i = namespaceMappings.keySet().iterator(); i.hasNext();) { Modified: branches/prototype2/DAVInspector/src/de/dlr/DAVInspector/plugins/RawPlugin.java =================================================================== --- branches/prototype2/DAVInspector/src/de/dlr/DAVInspector/plugins/RawPlugin.java 2008-02-20 13:25:42 UTC (rev 49) +++ branches/prototype2/DAVInspector/src/de/dlr/DAVInspector/plugins/RawPlugin.java 2008-02-20 23:09:44 UTC (rev 50) @@ -49,7 +49,6 @@ * * @see de.dlr.DAVInspector.ViewPlugin#getUI() */ - @Override public JComponent getUI() { return jTextPane; } @@ -59,7 +58,6 @@ * * @see de.dlr.DAVInspector.Plugin#getAuthor() */ - @Override public String getAuthor() { return "Jochen Wuest"; } @@ -69,7 +67,6 @@ * * @see de.dlr.DAVInspector.Plugin#getDescription() */ - @Override public String getDescription() { return "Raw view of the data."; } @@ -79,7 +76,6 @@ * * @see de.dlr.DAVInspector.Plugin#getName() */ - @Override public String getName() { return "Raw"; } @@ -89,7 +85,6 @@ * * @see de.dlr.DAVInspector.Plugin#getType() */ - @Override public PlugInType getType() { return PlugInType.ViewGeneral; } @@ -99,7 +94,6 @@ * * @see de.dlr.DAVInspector.Plugin#getVersion() */ - @Override public int getVersion() { return 1; } @@ -109,7 +103,6 @@ * * @see de.dlr.DAVInspector.Plugin#init() */ - @Override public void init() { if (jTextPane == null) { jTextPane = new JTextPane(); @@ -124,7 +117,6 @@ * * @see de.dlr.DAVInspector.Plugin#isActive() */ - @Override public Boolean isActive() { return active; } @@ -134,7 +126,6 @@ * * @see de.dlr.DAVInspector.Plugin#setActive(java.lang.Boolean) */ - @Override public void setActive(Boolean state) { active = state; } @@ -144,7 +135,6 @@ * * @see de.dlr.DAVInspector.Plugin#update(java.lang.String) */ - @Override public void update(String data) { // if (active) { jTextPane.setText(data); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-20 13:25:45
|
Revision: 49 http://davinspector.svn.sourceforge.net/davinspector/?rev=49&view=rev Author: wuest Date: 2008-02-20 05:25:42 -0800 (Wed, 20 Feb 2008) Log Message: ----------- Completed Comments and package description. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/configuration/Configuration.java trunk/DAVInspector/src/de/dlr/davinspector/configuration/package.html Modified: trunk/DAVInspector/src/de/dlr/davinspector/configuration/Configuration.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/configuration/Configuration.java 2008-02-20 12:32:00 UTC (rev 48) +++ trunk/DAVInspector/src/de/dlr/davinspector/configuration/Configuration.java 2008-02-20 13:25:42 UTC (rev 49) @@ -1,7 +1,7 @@ /* * Configuration.java * - * This Class stores the configuration of the DAVInspector. + * This Class stores and restores the configuration of the DAVInspector. * * Created: 21.12.2007 Jochen Wuest <joc...@dl...> * Changed: @@ -37,7 +37,7 @@ /** - * TODO: wues_ha: Enter comment! + * This Class stores and restores the configuration of the DAVInspector. * * @version $LastChangedRevision$ * @author Jochen Wuest @@ -47,178 +47,119 @@ /** * */ - private Properties properties; + private Properties myProperties; /** * Port number of the server connection. */ - private int serverPort; + private int myServerPort; /** * Port number of the client connection. */ - private int clientPort; + private int myClientPort; /** * Address of the server. */ - private String serverAddress; + private String myServerAddress; /** * Address of the client. */ - private String clientAddress; - + private String myClientAddress; + /** - * This list contains all available plugins that let you edit the traffic. + * This list contains all plugins to view messages to the server. */ - private List<IPlugin> availableEditPlugins; - - /** - * This list contains all available plugins that let you view the traffic. - */ - private List<IPlugin> availableViewPlugins; + private List<IPlugin> myActivePluginsServer; /** - * This list contains all plugins to view the traffic to the server. + * This list contains all plugins to view messages to the client. */ - private List<IPlugin> activeViewPluginsToServer; + private List<IPlugin> myActivePluginsClient; /** - * This list contains all plugins to view the traffic to the client. + * Constructor, loads the configuration from the configuration file. */ - private List<IPlugin> activeViewPluginsToClient; - - /** - * This list contains all plugins to edit the traffic to the server. - */ - private List<IPlugin> activeEditPluginsToServer; - - /** - * This list contains all plugins to edit the traffic to the server. - */ - private List<IPlugin> activeEditPluginsToClient; - - /** - * TODO: wues_ha: enter comment! - * - */ public Configuration() { loadConfiguration(); - availableEditPlugins = new Vector<IPlugin>(); - availableViewPlugins = new Vector<IPlugin>(); - // TODO: Load available plugins + // TODO: Load available plugins and check active-lists - activeViewPluginsToServer = new Vector<IPlugin>(); - activeViewPluginsToClient = new Vector<IPlugin>(); - activeEditPluginsToServer = new Vector<IPlugin>(); - activeEditPluginsToClient = new Vector<IPlugin>(); + myActivePluginsServer = new Vector<IPlugin>(); + myActivePluginsClient = new Vector<IPlugin>(); } /** - * TODO: wues_ha: Enter comment! + * Returns a vector with activated plugins on the server side. * * @return Vector */ - public List<IPlugin> getAvailableEditPlugins() { - return availableEditPlugins; + public List<IPlugin> getActivePluginsServer() { + return myActivePluginsServer; } /** - * TODO: wues_ha: Enter comment! + * Returns a vector with activated plugins on the client side. * * @return Vector */ - public List<IPlugin> getAvailableViewPlugins() { - return availableViewPlugins; + public List<IPlugin> getActivePluginsClient() { + return myActivePluginsClient; } /** - * TODO: wues_ha: Enter comment! + * Returns a String with the address of the server. * - * @return Vector + * @return String */ - public List<IPlugin> getActiveViewPluginsToServer() { - return activeViewPluginsToServer; - } - - /** - * TODO: wues_ha: Enter comment! - * - * @return Vector - */ - public List<IPlugin> getActiveViewPluginsToClient() { - return activeViewPluginsToClient; - } - - /** - * TODO: wues_ha: Enter comment! - * - * @return Vector - */ - public List<IPlugin> getActiveEditPluginsToServer() { - return activeEditPluginsToServer; - } - - /** - * TODO: wues_ha: Enter comment! - * - * @return Vector - */ - public List<IPlugin> getActiveEditPluginsToClient() { - return activeEditPluginsToClient; - } - - /** - * TODO: wues_ha: Enter comment! - * - * @return String with address of the server - */ public String getServerAddress() { - return serverAddress; + return myServerAddress; } /** - * TODO: wues_ha: Enter comment! + * Returns a Integer with the port of the server. * - * @return Integer Server port + * @return Integer */ public int getServerPort() { - return serverPort; + return myServerPort; } /** - * TODO: wues_ha: Enter comment! + * Returns a String with the address of the client. + * Usually empty. * - * @return String with address of the server + * @return String */ public String getClientAddress() { - return clientAddress; + return myClientAddress; } /** - * TODO: wues_ha: Enter comment! + * Returns a Integer with the port of the client. * - * @return Integer Server port + * @return Integer */ public int getClientPort() { - return clientPort; + return myClientPort; } /** - * TODO: wues_ha: Enter comment! - * + * This method loads the configuration from the configuration file. + * If the configuration file does not exist or a property is not set the default values + * from <code>Constant.java</code> are used. */ public void loadConfiguration() { - properties = new Properties(); + myProperties = new Properties(); try { - properties.load(new FileInputStream(Constant.CONFIGURATION_FILENAME)); + myProperties.load(new FileInputStream(Constant.APP_CONFIGURATION_FILENAME)); // assign properties to variables - serverAddress = properties.getProperty("ServerAddress", Constant.PROXY_SERVERADDRESS); - serverPort = Integer.parseInt(properties.getProperty("ServerPort", String.valueOf(Constant.PROXY_SERVERPORT))); - clientAddress = properties.getProperty("ClientAddress", Constant.PROXY_CLIENTADDRESS); - clientPort = Integer.parseInt(properties.getProperty("ClientPort", String.valueOf(Constant.PROXY_CLIENTPORT))); + myServerAddress = myProperties.getProperty("ServerAddress", Constant.RELAY_SERVERADDRESS); + myServerPort = Integer.parseInt(myProperties.getProperty("ServerPort", String.valueOf(Constant.RELAY_SERVERPORT))); + myClientAddress = myProperties.getProperty("ClientAddress", Constant.RELAY_CLIENTADDRESS); + myClientPort = Integer.parseInt(myProperties.getProperty("ClientPort", String.valueOf(Constant.RELAY_CLIENTPORT))); } catch (IOException ioe) { System.err.println(ioe); @@ -226,56 +167,55 @@ } /** - * TODO: wues_ha: Enter comment! - * + * This method stores the current configuration in the configuration file. */ public void storeConfiguration() { // save variables in properties - properties.setProperty("ServerAddress", serverAddress); - properties.setProperty("ServerPort", String.valueOf(serverPort)); - properties.setProperty("ClientAddress", clientAddress); - properties.setProperty("ClientPort", String.valueOf(clientPort)); + myProperties.setProperty("ServerAddress", myServerAddress); + myProperties.setProperty("ServerPort", String.valueOf(myServerPort)); + myProperties.setProperty("ClientAddress", myClientAddress); + myProperties.setProperty("ClientPort", String.valueOf(myClientPort)); try { - properties.store(new FileOutputStream(Constant.CONFIGURATION_FILENAME), null); + myProperties.store(new FileOutputStream(Constant.APP_CONFIGURATION_FILENAME), null); } catch (IOException ioe) { System.err.println(ioe); } } /** - * TODO: wues_ha: Enter comment! + * This method sets the address of the server. * - * @param serverAddressC server address + * @param serverAddress String */ - public void setServerAddress(String serverAddressC) { - this.serverAddress = serverAddressC; + public void setServerAddress(String serverAddress) { + this.myServerAddress = serverAddress; } /** - * TODO: wues_ha: Enter comment! + * This method sets the address of the client. * - * @param clientAddressC client address + * @param clientAddress String */ - public void setClientAddress(String clientAddressC) { - this.clientAddress = clientAddressC; + public void setClientAddress(String clientAddress) { + this.myClientAddress = clientAddress; } /** - * TODO: wues_ha: Enter comment! + * This method sets the port of the server. * - * @param serverPortC server port + * @param serverPort String */ - public void setServerPort(String serverPortC) { - this.serverPort = Integer.parseInt(serverPortC); + public void setServerPort(String serverPort) { + this.myServerPort = Integer.parseInt(serverPort); } /** - * TODO: wues_ha: Enter comment! + * This method sets the port of the client connection. * - * @param clientPortC client port + * @param clientPort String */ - public void setClientPort(String clientPortC) { - this.clientPort = Integer.parseInt(clientPortC); + public void setClientPort(String clientPort) { + this.myClientPort = Integer.parseInt(clientPort); } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/configuration/package.html =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/configuration/package.html 2008-02-20 12:32:00 UTC (rev 48) +++ trunk/DAVInspector/src/de/dlr/davinspector/configuration/package.html 2008-02-20 13:25:42 UTC (rev 49) @@ -1,12 +1,6 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> -<html><head><title>BLUB B</title></head><body> - -BLUB B - -<h2>Package Specification</h2> - -BLUB B - +<html><head><title>Configuration</title></head><body> +This package contains all classes needed for saving and restoring the configuration of the application. </body></html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-20 12:32:02
|
Revision: 48 http://davinspector.svn.sourceforge.net/davinspector/?rev=48&view=rev Author: wuest Date: 2008-02-20 04:32:00 -0800 (Wed, 20 Feb 2008) Log Message: ----------- Completed Comments and package description. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java trunk/DAVInspector/src/de/dlr/davinspector/common/Util.java trunk/DAVInspector/src/de/dlr/davinspector/common/package.html Modified: trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java 2008-02-20 12:15:14 UTC (rev 47) +++ trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java 2008-02-20 12:32:00 UTC (rev 48) @@ -1,7 +1,7 @@ /* * Constant.java * - * Definition of all needed constants. + * This class defines all needed constants. * * Created: 11.10.2007 Jochen Wuest <joc...@dl...> * Changed: @@ -29,59 +29,60 @@ /** - * Constants. + * This class defines all needed constants. + * * @version $LastChangedRevision$ * @author Jochen Wuest */ public final class Constant { /** - * GUI Width. + * Main window width. */ public static final int UI_MAIN_WINDOW_WIDTH = 800; /** - * GUI Height. + * Main window height. */ public static final int UI_MAIN_WINDOW_HEIGHT = 600; /** - * Configuration Dialog Width. + * Configuration dialog width. */ public static final int UI_CONFIG_DIALOG_WIDTH = 300; /** - * Configuration Dialog Height. + * Configuration dialog height. */ public static final int UI_CONFIG_DIALOG_HEIGHT = 200; /** - * + * Plugin configuration width. */ public static final int UI_PLUGIN_CONFIG_DIALOG_WIDTH = 650; /** - * + * Plugin configuration height. */ public static final int UI_PLUGIN_CONFIG_DIALOG_HEIGTH = 250; /** - * + * About dialog width. */ public static final int UI_ABOUT_DIALOG_WIDTH = 250; /** - * + * About dialog height. */ public static final int UI_ABOUT_DIALOG_HEIGTH = 175; /** - * + * Backgroundcolor of replies. */ public static final Color UI_REPLY_COLOR = new Color(255, 204, 102); /** - * + * Backgroundcolor of requests. */ public static final Color UI_REQUEST_COLOR = new Color(170, 240, 240); @@ -101,7 +102,7 @@ public static final String CR = "\n"; /** - * EOF. + * End Of File. */ public static final int EOF = -1; @@ -111,69 +112,68 @@ public static final String APP_TITLE = "DAVInspector"; /** - * Filename of the configuration file. + * Version of the application. */ public static final String APP_VERSION = "0.1"; /** * Filename of the configuration file. */ - public static final String CONFIGURATION_FILENAME = "config.properties"; + public static final String APP_CONFIGURATION_FILENAME = "config.properties"; /** - * Timeout waiting for a StreamCopyThread to finish in ms. + * Timeout waiting for a ChannelThread to finish in ms. */ - public static final int PROXY_THREADTIMEOUT = 1; + public static final int RELAY_THREADTIMEOUT = 100; /** * Linger time in seconds for socket. */ - public static final int PROXY_LINGERTIME = 1; + public static final int RELAY_LINGERTIME = 100; /** * Size of the receive buffer. */ - public static final int PROXY_RECVBUFFERSIZE = 2048; - + public static final int RELAY_RECVBUFFERSIZE = 2048; + /** * Backlog parameter used when creating the ServerSocket. */ - public static final int PROXY_BACKLOG = 1; + public static final int RELAY_BACKLOG = 1; /** * Address of the Server. IP address or domain name. */ - public static final String PROXY_SERVERADDRESS = "localhost"; //"bsasdf01.as.bs.dlr.de"; + public static final String RELAY_SERVERADDRESS = "localhost"; //"bsasdf01.as.bs.dlr.de"; /** * Server port. */ - public static final int PROXY_SERVERPORT = 8080; + public static final int RELAY_SERVERPORT = 8080; /** * Address of the Client. Normally this is empty and * the address of the client is of no importance. */ - public static final String PROXY_CLIENTADDRESS = ""; + public static final String RELAY_CLIENTADDRESS = ""; /** * Client port. */ - public static final int PROXY_CLIENTPORT = 8888; + public static final int RELAY_CLIENTPORT = 8888; /** - * + * Classpath to the plugins. */ public static final String PLUGIN_CLASSPATH = "de.dlr.davinspector.plugins."; /** - * + * Path to the resources, e.g. graphics and icons. */ - public static final String RESOURCE_PATH = "/de/dlr/davinspector/resource/"; - + public static final String RESOURCE_PATH = "/de/dlr/davinspector/resource/"; + /** - * TODO: wues_ha: enter comment! - * + * Empty Constructor. */ private Constant() { Modified: trunk/DAVInspector/src/de/dlr/davinspector/common/Util.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/common/Util.java 2008-02-20 12:15:14 UTC (rev 47) +++ trunk/DAVInspector/src/de/dlr/davinspector/common/Util.java 2008-02-20 12:32:00 UTC (rev 48) @@ -3,7 +3,7 @@ * * Utility functions. * - * Created: 04.02.2008 HJW <email> + * Created: 04.02.2008 Jochen Wuest <joc...@dl...> * Changed: * * $Id$ @@ -34,7 +34,7 @@ /** - * TODO: HJW: Enter comment! + * Utility functions. * * @version $LastChangedRevision$ * @author Jochen Wuest @@ -42,16 +42,14 @@ public final class Util { /** - * TODO: HJW: enter comment! - * + * Empty Contructor for utility class. */ private Util() { } /** - * TODO: HJW: Enter comment! - * + * This method tries to set the look & feel of the current OS. */ public static void setUIDesign() { try { @@ -68,7 +66,7 @@ } /** - * TODO: HJW: Enter comment! + * This method centers a given window in the center of the screen. * * @param window Window */ Modified: trunk/DAVInspector/src/de/dlr/davinspector/common/package.html =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/common/package.html 2008-02-20 12:15:14 UTC (rev 47) +++ trunk/DAVInspector/src/de/dlr/davinspector/common/package.html 2008-02-20 12:32:00 UTC (rev 48) @@ -1,12 +1,6 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> -<html><head><title>BLUB B</title></head><body> - -BLUB B - -<h2>Package Specification</h2> - -BLUB B - +<html><head><title>Common</title></head><body> +This package contains classes for global usage. </body></html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-20 12:15:29
|
Revision: 47 http://davinspector.svn.sourceforge.net/davinspector/?rev=47&view=rev Author: wuest Date: 2008-02-20 04:15:14 -0800 (Wed, 20 Feb 2008) Log Message: ----------- Added the MessageListeners and enabled loading of messages. Completed Comments and package description. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java trunk/DAVInspector/src/de/dlr/davinspector/history/package.html Added Paths: ----------- trunk/DAVInspector/src/de/dlr/davinspector/history/INewMessageListener.java trunk/DAVInspector/src/de/dlr/davinspector/history/IRefreshMessageListener.java trunk/DAVInspector/src/de/dlr/davinspector/history/MessageEvent.java Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java 2008-02-20 10:44:53 UTC (rev 46) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java 2008-02-20 12:15:14 UTC (rev 47) @@ -1,7 +1,7 @@ /* * HistoryTableCellRenderer.java * - * This class renders the history table cells (colors, direction, etc.). + * This class renders the history table cells (colors, message direction). * * Created: 21.01.2008 Jochen Wuest <joc...@dl...> * Changed: @@ -25,8 +25,8 @@ package de.dlr.davinspector.history; -import java.awt.Color; import java.awt.Component; +import java.awt.SystemColor; import javax.swing.JTable; import javax.swing.table.DefaultTableCellRenderer; @@ -36,7 +36,7 @@ /** - * TODO: wues_ha: Enter comment! + * This class renders the history table cells (colors, message direction). * * @version $LastChangedRevision$ * @author Jochen Wuest @@ -49,10 +49,10 @@ private static final long serialVersionUID = 1L; /** - * + * Used to save the state of a message to color a complete row. */ - private Boolean isRequest = false; - + private Boolean isRequest; + /** * {@inheritDoc} * @@ -64,22 +64,23 @@ super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - if (value instanceof Boolean){ - isRequest = ((Boolean) value).booleanValue(); - if (isRequest) { - setText("Request"); + if (value instanceof Message.MessageType){ + if (value.equals(Message.MessageType.Request)) { + setText("Request"); + isRequest = true; } else { setText("Reply"); + isRequest = false; } } else { setText(value.toString()); } if (hasFocus || isSelected) { - setForeground(Color.getColor("textHighlighttext")); - setBackground(Color.getColor("textHighlight")); + setForeground(SystemColor.textHighlightText); + setBackground(SystemColor.textHighlight); } else { - setForeground(Color.getColor("windowText")); + setForeground(SystemColor.textText); if (isRequest) { setBackground(Constant.UI_REQUEST_COLOR); } else { Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java 2008-02-20 10:44:53 UTC (rev 46) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java 2008-02-20 12:15:14 UTC (rev 47) @@ -28,12 +28,12 @@ import javax.swing.table.DefaultTableModel; /** - * TODO: wues_ha: Enter comment! + * Data model for the history table. * * @version $LastChangedRevision$ * @author Jochen Wuest */ -public class HistoryTableModel extends DefaultTableModel { +public class HistoryTableModel extends DefaultTableModel implements INewMessageListener { /** * @@ -41,7 +41,7 @@ private static final long serialVersionUID = 0L; /** - * + * Column Definition for history table. */ private String[] columnNames = { "Type", @@ -76,4 +76,16 @@ public boolean isCellEditable(int row, int col) { return false; } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.history.INewMessageListener#newMessage(de.dlr.davinspector.history.MessageEvent) + */ + public void newMessage(MessageEvent newMessageEvent) { + // update history table + Message msg = newMessageEvent.getMessage(); + addRow(new Object[]{msg.getMessageType(), msg.getId(), msg.getTimestamp(), msg.getSize()}); + fireTableDataChanged(); + } } Added: trunk/DAVInspector/src/de/dlr/davinspector/history/INewMessageListener.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/INewMessageListener.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/INewMessageListener.java 2008-02-20 12:15:14 UTC (rev 47) @@ -0,0 +1,45 @@ +/* + * INewMessageListener.java + * + * Listeners which implement this interface are notified if a new message is available. + * + * Created: 18.02.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.history; + +import java.util.EventListener; + + +/** + * Refresh message listener interface. + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public interface INewMessageListener extends EventListener { + + /** + * Invoked when a new message has arrived. + * + * @param newMessageEvent {@link MessageEvent} + */ + void newMessage(MessageEvent newMessageEvent); +} Added: trunk/DAVInspector/src/de/dlr/davinspector/history/IRefreshMessageListener.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/IRefreshMessageListener.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/IRefreshMessageListener.java 2008-02-20 12:15:14 UTC (rev 47) @@ -0,0 +1,46 @@ +/* + * IRefreshMessageListener.java + * + * Listeners which implement this interface are notified if a message is + * loaded from the message history. + * + * Created: 19.02.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.history; + +import java.util.EventListener; + + +/** + * Refresh message listener interface. + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public interface IRefreshMessageListener extends EventListener { + + /** + * Invoked when a message has been loaded. + * + * @param refreshMessageEvent {@link MessageEvent} + */ + void refreshMessage(MessageEvent refreshMessageEvent); +} Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java 2008-02-20 10:44:53 UTC (rev 46) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java 2008-02-20 12:15:14 UTC (rev 47) @@ -1,7 +1,7 @@ /* * Message.java * - * Representation of a message. + * This class represents a single message. * * Created: 15.01.2008 Jochen Wuest <joc...@dl...> * Changed: @@ -29,22 +29,27 @@ /** - * TODO: wues_ha: Enter comment! + * This class represents a single message. * * @version $LastChangedRevision$ * @author Jochen Wuest */ public class Message { + /** * */ private static int idCounter; /** - * TODO: wues_ha: Enter comment! + * Message type indicates the direction of the message: + * <ul> + * <li>Message from client to server: Request.</li> + * <li>Message from server to client: Response.</li> + * </ul> * * @version $LastChangedRevision$ - * @author wues_ha + * @author Jochen Wuest */ public enum MessageType { /** @@ -58,63 +63,73 @@ } /** - * + * Unique ID of a message. */ - private int id; + private int myID; /** * */ - private Date timestamp; + private Date myTimestamp; /** - * + * Type indicates the direction of the message. + * @see MessageType */ - private MessageType type; + private MessageType myType; /** - * + * This string contains the raw data of the message. */ - private String data; + private String myData; /** - * + * This string contains the body of the message. */ - private int size; + private String myMessageBody; /** - * TODO: wues_ha: enter comment! + * This string contains the head of the message. + */ + private String myMessageHeader; + + /** * */ + private int mySize; + + /** + * Constructor, every new message increases <code>idCounter</code>. + */ public Message() { ++idCounter; } /** - * TODO: wues_ha: Enter comment! + * This method returns the ID of the message. * * @return id */ public int getId() { - return id; + return myID; } /** - * TODO: wues_ha: Enter comment! + * This method returns the timestamp of the message. * * @return timestamp */ public Date getTimestamp() { - return timestamp; + return myTimestamp; } /** - * TODO: wues_ha: Enter comment! * - * @param ts Date/Timestamp + * + * @param timestamp Date/Timestamp */ - public void setTimestamp(Date ts) { - this.timestamp = ts; + public void setTimestamp(Date timestamp) { + myTimestamp = timestamp; } /** @@ -123,57 +138,125 @@ * @return toClient */ public MessageType getMessageType() { - return type; + return myType; } /** * TODO: wues_ha: Enter comment! * - * @param t MessageType + * @param type MessageType */ - public void setMessageType(MessageType t) { - this.type = t; + public void setMessageType(MessageType type) { + myType = type; } /** - * TODO: wues_ha: Enter comment! + * This method sets the message type. + * @see MessageType * * @param toClient Boolean */ public void setMessageType(Boolean toClient) { if (toClient) { - this.type = MessageType.Response; + myType = MessageType.Response; } else { - this.type = MessageType.Request; + myType = MessageType.Request; } } /** - * TODO: wues_ha: Enter comment! + * Returns the raw Data. * - * @return data + * @return data String */ public String getData() { - return data; + return myData; } /** - * TODO: wues_ha: Enter comment! + * Sets the raw data of the current message. + * Message size, ID, body and header are automatically added. * * @param msg String */ public void setData(String msg) { - this.data = msg; - this.size = msg.length(); - this.id = idCounter; + myData = msg; + mySize = msg.length(); + myID = idCounter; + + myMessageBody = extractMessageBody(msg); + myMessageHeader = extractMessageHeader(msg); } /** - * TODO: wues_ha: Enter comment! + * Returns the Head of the message. * - * @return size + * @return String */ + public String getMessageHeader() { + return myMessageHeader; + } + + /** + * Returns the body of the message. + * + * @return String + */ + public String getMessageBody() { + return myMessageBody; + } + + /** + * Returns the size of the message in bytes. + * + * @return size int + */ public int getSize() { - return size; - } + return mySize; + } + + /** + * Extracts the body of the message from the raw data. + * + * @param input String containig http packet + * @return String with body + */ + private String extractMessageBody(String input) { + String result = ""; + + // HTTP/1.1 HTTP/1.0 HTTP/0.9 + // TODO: split input into different HTTP messages + //String[] httpMessages = input.split("HTTP/[1.1|1.0|0.9]{1}"); + + // TODO: nur die erste Nachricht wird angezeigt + //input = httpMessages[0]; + + String[] s = input.split("\r\n\r\n"); + for (int i = 1; i < s.length; i++) { + result = s[i]; + } + + + // detect and process chunked data + // split the input in the different chunks. + // each chunk starts with the length of the chunk in hex. + String[] lines = result.split("(\r\n[0-9a-fA-F]+\r\n)"); + result = ""; + for (int i = 0; i < lines.length; i++) { + result += lines[i]; + } + + return result; + } + + /** + * Extracts the header of the message from the raw data. + * + * @param input String containing http packet + * @return String with headers + */ + private String extractMessageHeader(String input) { + String[] s = input.split("\r\n\r\n"); + return s[0]; + } } Added: trunk/DAVInspector/src/de/dlr/davinspector/history/MessageEvent.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/MessageEvent.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/MessageEvent.java 2008-02-20 12:15:14 UTC (rev 47) @@ -0,0 +1,69 @@ +/* + * MessageEvent.java + * + * This class represents a message event. + * + * Created: 18.02.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.history; + +import java.util.EventObject; + + +/** + * This class represents a message event. + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public class MessageEvent extends EventObject { + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * The message. + */ + private Message myMessage; + + /** + * Constructor for a new message event. + * + * @param source Object + * @param msg {@link Message} + */ + public MessageEvent(Object source, Message msg) { + super(source); + myMessage = msg; + } + + /** + * This method returns the current message. + * + * @return {@link Message} + */ + public Message getMessage() { + return myMessage; + } + +} Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java 2008-02-20 10:44:53 UTC (rev 46) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java 2008-02-20 12:15:14 UTC (rev 47) @@ -26,10 +26,17 @@ package de.dlr.davinspector.history; import java.util.Date; +import java.util.Iterator; import java.util.List; import java.util.Vector; +import javax.swing.event.EventListenerList; +import de.dlr.davinspector.relay.IClientListener; +import de.dlr.davinspector.relay.IRelayModel; +import de.dlr.davinspector.relay.IServerListener; + + /** * This class saves and provides access * to the processed messages. @@ -37,65 +44,181 @@ * @version $LastChangedRevision$ * @author Jochen Wuest */ -public class MessageHistory { +public class MessageHistory implements IServerListener, IClientListener { + /** - * + * List of listeners for new messages. */ - private List<Message> messages = null; + private EventListenerList myListenersNewMessage = new EventListenerList(); /** - * TODO: wues_ha: enter comment! - * + * List of listeners for refresh. */ - public MessageHistory() { - messages = new Vector<Message>(); - } + private EventListenerList myListenersRefreshMessage = new EventListenerList(); + + /** + * This string buffers the client side raw data. + */ + private String myClientsideBuffer; /** - * TODO: wues_ha: Enter comment! + * This string buffers the server side raw data. + */ + private String myServersideBuffer; + + /** + * This vector stores the messages. + */ + private List<Message> myMessages = null; + + /** + * Reference to the relay model. + */ + private IRelayModel myRelay = null; + + /** + * Constructor for message history. Client and server buffers and the + * vector for storing the messages are initialized and listeners for + * server and client side are registered. * - * @param data String - * @param toClient Boolean - * @param ts Date + * @param relay {@link IRelayModel} + */ + public MessageHistory(IRelayModel relay) { + myRelay = relay; + myMessages = new Vector<Message>(); + myClientsideBuffer = ""; + myServersideBuffer = ""; + + myRelay.registerClientListener((IClientListener) this); + myRelay.registerServerListener((IServerListener) this); + } + + /** + * This method creates a new message and stores it. + * Afterwards a {@link MessageEvent} is generated and all {@link INewMessageListener} are notified. + * + * @param data String + * @param toClient Boolean + * @param timestamp Date */ - public void storeMessage(String data, Boolean toClient, Date ts) { + public void storeMessage(String data, Boolean toClient, Date timestamp) { // store Message - Message msg = new Message(); - msg.setMessageType(toClient); - msg.setData(data); - msg.setTimestamp(new Date()); - messages.add(msg); - - //update history table - //myTableModel.addRow(new Object[]{msg.getClientToSever(), msg.getId(), msg.getTimestamp(), msg.getSize()}); - //myTableModel.fireTableDataChanged(); - - //update plugins - //List<Plugin> plugged = pluginManager.getAvailablePlugins(); - //for (Iterator<Plugin> iterator = plugged.iterator(); iterator.hasNext();) { - //Plugin plugin = (Plugin) iterator.next(); - //plugin.update(data); - //} + Message message = new Message(); + message.setMessageType(toClient); + message.setData(data); + message.setTimestamp(new Date()); + myMessages.add(message); + + notifyNewMessage(new MessageEvent(this, message)); } /** - * TODO: wues_ha: Enter comment! + * This method loads a message identified by the ID. + * Afterwards a {@link MessageEvent} is generated and all {@link IRefreshMessageListener} are notified. * - * @param idx int - * @return Message + * @param id int */ - public Message getMessage(int idx) { - return new Message(); + public void loadMessageByID(int id) { + for (Iterator<Message> iterator = myMessages.iterator(); iterator.hasNext();) { + Message message = (Message) iterator.next(); + if (message.getId() == id) { + notifyRefreshMessage(new MessageEvent(this, message)); + break; + } + } } /** - * TODO: wues_ha: Enter comment! - * - * @param id int - * @return Message + * {@inheritDoc} + * + * @see de.dlr.davinspector.relay.IClientListener#updateClient(java.lang.String) */ - public Message getMessageById(int id) { - return new Message(); + public void updateClient(String data) { + myClientsideBuffer += data; + processRawData(); + storeMessage(myClientsideBuffer, false, new Date()); + myClientsideBuffer = ""; } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.relay.IServerListener#updateServer(java.lang.String) + */ + public void updateServer(String data) { + myServersideBuffer += data; + processRawData(); + storeMessage(myServersideBuffer, true, new Date()); + myServersideBuffer = ""; + } + + /** + * Processes Client and Server data. + * Data is split into messages by Content-Header-Length (if set) or EOF. + * TODO: maybe here or in the message class itsself !? + */ + private void processRawData() { + + } + + /** + * Adds an {@link INewMessageListener} to MessageHistory. + * + * @param listener the {@link INewMessageListener} to be added + */ + public void addNewMessageListener(INewMessageListener listener) { + myListenersNewMessage.add(INewMessageListener.class, listener); + } + + /** + * Removes an {@link INewMessageListener} from MessageHistory. + * + * @param listener the {@link INewMessageListener} to be removed + */ + public void removeNewMessageListener(INewMessageListener listener) { + myListenersNewMessage.remove(INewMessageListener.class, listener); + } + + /** + * Notifies all {@link INewMessageListener}s that have registered interest for + * notification on an {@link MessageEvent}. + * + * @param event the {@link MessageEvent} object + */ + protected synchronized void notifyNewMessage(MessageEvent event) { + for (INewMessageListener listener : myListenersNewMessage.getListeners(INewMessageListener.class)) { + listener.newMessage(event); + } + } + + /** + * Adds an {@link IRefreshMessageListener} to MessageHistory. + * + * @param listener the {@link IRefreshMessageListener} to be added + */ + public void addRefreshMessageListener(IRefreshMessageListener listener) { + myListenersRefreshMessage.add(IRefreshMessageListener.class, listener); + } + + /** + * Removes an {@link IRefreshMessageListener} from MessageHistory. + * + * @param listener the {@link IRefreshMessageListener} to be removed + */ + public void removeRefreshMessageListener(IRefreshMessageListener listener) { + myListenersRefreshMessage.remove(IRefreshMessageListener.class, listener); + } + + /** + * Notifies all {@link IRefreshMessageListener}s that have registered interest for + * notification on an {@link MessageEvent}. + * + * @param event the {@link MessageEvent} object + */ + protected synchronized void notifyRefreshMessage(MessageEvent event) { + for (IRefreshMessageListener listener : myListenersRefreshMessage.getListeners(IRefreshMessageListener.class)) { + listener.refreshMessage(event); + } + } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/package.html =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/package.html 2008-02-20 10:44:53 UTC (rev 46) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/package.html 2008-02-20 12:15:14 UTC (rev 47) @@ -1,12 +1,6 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> -<html><head><title>BLUB B</title></head><body> - -BLUB B - -<h2>Package Specification</h2> - -BLUB B - +<html><head><title>History</title></head><body> +This package contains all classes and interfaces needed to handle messages. </body></html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-20 10:45:00
|
Revision: 46 http://davinspector.svn.sourceforge.net/davinspector/?rev=46&view=rev Author: wuest Date: 2008-02-20 02:44:53 -0800 (Wed, 20 Feb 2008) Log Message: ----------- Added *.jar file filter and completed comments. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java Added Paths: ----------- trunk/DAVInspector/src/de/dlr/davinspector/plugin/JarFilenameFilter.java Added: trunk/DAVInspector/src/de/dlr/davinspector/plugin/JarFilenameFilter.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/JarFilenameFilter.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/JarFilenameFilter.java 2008-02-20 10:44:53 UTC (rev 46) @@ -0,0 +1,49 @@ +/* + * JarFilenameFilter.java + * + * This class is used to filter only *.jar files. + * + * Created: 20.02.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.plugin; + +import java.io.File; +import java.io.FilenameFilter; + + +/** + * This class is used to filter only *.jar files. + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public class JarFilenameFilter implements FilenameFilter { + + /** + * {@inheritDoc} + * + * @see java.io.FilenameFilter#accept(java.io.File, java.lang.String) + */ + public boolean accept(File directory, String filename) { + return filename.toLowerCase().endsWith(".jar"); + } + +} Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-02-09 18:08:49 UTC (rev 45) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-02-20 10:44:53 UTC (rev 46) @@ -37,16 +37,18 @@ import de.dlr.davinspector.common.Constant; /** - * TODO: wues_ha: Enter comment! - * Fast and thread safe implementation of the Singleton pattern. + * This class loads all available plugins and manages the activated plugins + * for the server and client connection. + * Singleton * * @version $LastChangedRevision$ * @author Markus Litz * @author Jochen Wuest */ public final class PluginManager { + /** - * + * */ private static PluginManager instance = new PluginManager(); @@ -56,7 +58,7 @@ private Map<String, URLClassLoader> loaderHashmap = new HashMap<String, URLClassLoader>(); /** - * + * Vector containing all loaded plugins. */ private List<IPlugin> pluginVector = new Vector<IPlugin>(); @@ -67,7 +69,7 @@ private PluginManager() {} /** - * Static method, returns the only instance of this class. + * Static method, returns the <b>only</b> instance of this class. * * @return PluginManager */ @@ -76,37 +78,33 @@ } /** - * TODO: wues_ha: Enter comment! - * + * Searches the plugin directory for jar files and tries to load them + * via <code>loadPlugin</code>. */ public void loadAllPlugins() { - //\xFCber jar-dateien im plugin-verzeichnis iterieren - // TODO: filter f\xFCr jar dateien - File pluginVZ = new File("plugins"); - if (pluginVZ.isDirectory()) { - String[] fils = pluginVZ.list(); - String pathToPluginDir = pluginVZ.getAbsolutePath(); - //foreach - for (int i = 0; i < fils.length; ++i) { - File plug = new File(pathToPluginDir + "/" + fils[i]); - loadPlugin(plug.getAbsoluteFile()); + File pluginDirectory = new File("plugins"); + if (pluginDirectory.isDirectory()) { + String[] jarFiles = pluginDirectory.list(new JarFilenameFilter()); + String pathToPluginDir = pluginDirectory.getAbsolutePath(); + for (String jarFile : jarFiles) { + File plug = new File(pathToPluginDir + "/" + jarFile); + loadPlugin(plug.getAbsoluteFile()); } } } /** + * Load a plugin from a given Java File variable via URLClassLoader. * - * load a plugin from a given Java-File-var. - * - * @param jarfile File + * @param jarFile File */ - public void loadPlugin(File jarfile) { + public void loadPlugin(File jarFile) { IPlugin plugin = null; - String name = jarfile.getName().substring(0, jarfile.getName().lastIndexOf(".")); + String name = jarFile.getName().substring(0, jarFile.getName().lastIndexOf(".")); try { - URLClassLoader jClassLoader = new URLClassLoader(new URL[] { jarfile.toURI().toURL() }); + URLClassLoader jClassLoader = new URLClassLoader(new URL[] { jarFile.toURI().toURL() }); Class<?> c = jClassLoader.loadClass(Constant.PLUGIN_CLASSPATH + name.toLowerCase() + "." + name); - // lets try to load plugin... + // lets try to load the plugin... plugin = (IPlugin) c.newInstance(); plugin.init(); // ok, the plugin is initialized @@ -122,12 +120,13 @@ System.err.println(iae); } catch (IOException ioe) { System.err.println(ioe); - jarfile.delete(); + jarFile.delete(); } } /** * Returns Vector containing the available plugins. + * * @return List pluginVector */ public List<IPlugin> getAvailablePlugins() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-09 18:08:55
|
Revision: 45 http://davinspector.svn.sourceforge.net/davinspector/?rev=45&view=rev Author: wuest Date: 2008-02-09 10:08:49 -0800 (Sat, 09 Feb 2008) Log Message: ----------- Cleaned build.xml and added separated os-specific stuff in build-user.xml. Modified Paths: -------------- trunk/DAVInspector/build-user.xml trunk/DAVInspector/build.xml Modified: trunk/DAVInspector/build-user.xml =================================================================== --- trunk/DAVInspector/build-user.xml 2008-02-09 15:51:33 UTC (rev 44) +++ trunk/DAVInspector/build-user.xml 2008-02-09 18:08:49 UTC (rev 45) @@ -1,12 +1,30 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?eclipse.ant.import?> <project> + <target name="dist" description="Generates distribution in subdirectory dist"> + <!-- Handle OS-specific properties --> + <condition property="isWindows"> + <os family="windows" /> + </condition> + <condition property="isUnix"> + <os family="unix" /> + </condition> + <antcall target="os-independent"/> + </target> - <target name="dist" description="Generates distribution in subdirectory dist"> + <target name="linux" if="isUnix"> + <!-- Change to desired location --> + <property name="dist" location="/usr/local/DAVInspector" /> + </target> - <!-- Change to desired location --> + <target name="win32" if="isWindows"> + <!-- Change to desired location --> <property name="dist" location="C:/Programme/DAVInspector" /> - + </target> + + <target name="os-independent" depends="linux,win32"> + <echo>Distribution directory ${dist}</echo> + <!-- Create necessary directories --> <delete dir="${dist}" /> Modified: trunk/DAVInspector/build.xml =================================================================== --- trunk/DAVInspector/build.xml 2008-02-09 15:51:33 UTC (rev 44) +++ trunk/DAVInspector/build.xml 2008-02-09 18:08:49 UTC (rev 45) @@ -4,20 +4,20 @@ To include a user specific buildfile here, simply create one in the same directory with the processing instruction <?eclipse.ant.import?> as the first entry and export the buildfile again. --> -<project basedir="." default="build" name="DAVInspector-Prototyp2"> +<project basedir="." default="build" name="DAVInspector"> <property environment="env"/> - <property name="ECLIPSE_HOME" value="../../../../Programme/eclipse"/> + <property name="ECLIPSE_HOME" value="${eclipse.home}"/> <property name="debuglevel" value="source,lines,vars"/> - <property name="target" value="1.6"/> - <property name="source" value="1.6"/> + <property name="target" value="1.5"/> + <property name="source" value="1.5"/> <import file="build-user.xml" /> - <path id="DAVInspector-Prototyp2.classpath"> + <path id="DAVInspector.classpath"> <pathelement location="bin"/> </path> <target name="init"> <mkdir dir="bin"/> <copy includeemptydirs="false" todir="bin"> - <fileset dir="src" excludes="**/*.uad, **/*.ucd, **/*.uld, **/*.upd, **/*.udd, **/*.uod, **/*.usd, **/*.utd, **/*.uud, **/*.odd, **/*.ead, **/*.ecd, **/*.eld, **/*.epd, **/*.edd, **/*.eod, **/*.esd, **/*.etd, **/*.eud, **/*.urd*.uml, **/*.ecore, **/*.launch, **/*.java"/> + <fileset dir="src" excludes="**/*.launch, **/*.java"/> </copy> </target> <target name="clean"> @@ -30,7 +30,7 @@ <echo message="${ant.project.name}: ${ant.file}"/> <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}"> <src path="src"/> - <classpath refid="DAVInspector-Prototyp2.classpath"/> + <classpath refid="DAVInspector.classpath"/> </javac> </target> <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/> @@ -47,14 +47,4 @@ <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/> <antcall target="build"/> </target> - <target name="New_configuration (2)"> - <java classname="" failonerror="true" fork="yes"> - <classpath refid="DAVInspector-Prototyp2.classpath"/> - </java> - </target> - <target name="DAVInspector"> - <java classname="de.dlr.DAVInspector.DAVInspector" failonerror="true" fork="yes"> - <classpath refid="DAVInspector-Prototyp2.classpath"/> - </java> - </target> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-09 15:51:41
|
Revision: 44 http://davinspector.svn.sourceforge.net/davinspector/?rev=44&view=rev Author: wuest Date: 2008-02-09 07:51:33 -0800 (Sat, 09 Feb 2008) Log Message: ----------- Removed file/folder Removed Paths: ------------- trunk/DAVInspector/bin/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-08 15:20:50
|
Revision: 43 http://davinspector.svn.sourceforge.net/davinspector/?rev=43&view=rev Author: wuest Date: 2008-02-08 07:20:43 -0800 (Fri, 08 Feb 2008) Log Message: ----------- Deleted unnecessary files. Removed Paths: ------------- trunk/DAVInspector/src/.externalToolBuilders/ trunk/DAVInspector/src/.settings/ Property Changed: ---------------- trunk/DAVInspector/bin/ trunk/DAVInspector/src/de/ trunk/DAVInspector/src/de/dlr/ Property changes on: trunk/DAVInspector/bin ___________________________________________________________________ Name: svn:ignore + .* Property changes on: trunk/DAVInspector/src/de ___________________________________________________________________ Name: svn:ignore + .* Property changes on: trunk/DAVInspector/src/de/dlr ___________________________________________________________________ Name: svn:ignore + .* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-08 15:08:55
|
Revision: 42 http://davinspector.svn.sourceforge.net/davinspector/?rev=42&view=rev Author: wuest Date: 2008-02-08 07:08:46 -0800 (Fri, 08 Feb 2008) Log Message: ----------- Deleted unnecessary files. Removed Paths: ------------- trunk/DAVInspector/.classpath trunk/DAVInspector/.project trunk/DAVInspector/.settings/ Deleted: trunk/DAVInspector/.classpath =================================================================== --- trunk/DAVInspector/.classpath 2008-02-08 14:55:32 UTC (rev 41) +++ trunk/DAVInspector/.classpath 2008-02-08 15:08:46 UTC (rev 42) @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="output" path="bin"/> -</classpath> Deleted: trunk/DAVInspector/.project =================================================================== --- trunk/DAVInspector/.project 2008-02-08 14:55:32 UTC (rev 41) +++ trunk/DAVInspector/.project 2008-02-08 15:08:46 UTC (rev 42) @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>DAVInspector</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-08 14:55:39
|
Revision: 41 http://davinspector.svn.sourceforge.net/davinspector/?rev=41&view=rev Author: wuest Date: 2008-02-08 06:55:32 -0800 (Fri, 08 Feb 2008) Log Message: ----------- Deleted "@override" declarations. Removed test prints from PluginManager. Added multiple connection management to Relay. Deleted 16px application icon. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationTableModel.java trunk/DAVInspector/src/de/dlr/davinspector/ui/UIResource.java Removed Paths: ------------- trunk/DAVInspector/resource/inspector16.png Deleted: trunk/DAVInspector/resource/inspector16.png =================================================================== (Binary files differ) Modified: trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java 2008-02-07 16:37:25 UTC (rev 40) +++ trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java 2008-02-08 14:55:32 UTC (rev 41) @@ -123,22 +123,22 @@ /** * Timeout waiting for a StreamCopyThread to finish in ms. */ - public static final int PROXY_THREADTIMEOUT = 100; + public static final int PROXY_THREADTIMEOUT = 1; /** * Linger time in seconds for socket. */ - public static final int PROXY_LINGERTIME = 5; + public static final int PROXY_LINGERTIME = 1; /** * Size of the receive buffer. */ - public static final int PROXY_RECVBUFFERSIZE = 1024; + public static final int PROXY_RECVBUFFERSIZE = 2048; /** * Backlog parameter used when creating the ServerSocket. */ - public static final int PROXY_BACKLOG = 100; + public static final int PROXY_BACKLOG = 1; /** * Address of the Server. IP address or domain name. Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java 2008-02-07 16:37:25 UTC (rev 40) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java 2008-02-08 14:55:32 UTC (rev 41) @@ -55,7 +55,6 @@ * * @see javax.swing.table.TableModel#getColumnCount() */ - @Override public int getColumnCount() { return columnNames.length; } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-02-07 16:37:25 UTC (rev 40) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-02-08 14:55:32 UTC (rev 41) @@ -82,7 +82,6 @@ public void loadAllPlugins() { //\xFCber jar-dateien im plugin-verzeichnis iterieren // TODO: filter f\xFCr jar dateien - System.err.println("loading plugins ..."); File pluginVZ = new File("plugins"); if (pluginVZ.isDirectory()) { String[] fils = pluginVZ.list(); @@ -105,15 +104,15 @@ IPlugin plugin = null; String name = jarfile.getName().substring(0, jarfile.getName().lastIndexOf(".")); try { - URLClassLoader jcl = new URLClassLoader(new URL[] { jarfile.toURI().toURL() }); - Class<?> c = jcl.loadClass(Constant.PLUGIN_CLASSPATH + name.toLowerCase() + "." + name); + URLClassLoader jClassLoader = new URLClassLoader(new URL[] { jarfile.toURI().toURL() }); + Class<?> c = jClassLoader.loadClass(Constant.PLUGIN_CLASSPATH + name.toLowerCase() + "." + name); // lets try to load plugin... plugin = (IPlugin) c.newInstance(); plugin.init(); // ok, the plugin is initialized if (plugin != null) { pluginVector.add(plugin); - loaderHashmap.put(name, jcl); + loaderHashmap.put(name, jClassLoader); } } catch (ClassNotFoundException cnfe) { System.err.println(cnfe); Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java 2008-02-07 16:37:25 UTC (rev 40) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java 2008-02-08 14:55:32 UTC (rev 41) @@ -147,7 +147,6 @@ * * @see org.xml.sax.ContentHandler#characters(char[], int, int) */ - @Override public void characters(char[] ch, int start, int length) throws SAXException { String s = new String(ch, start, length).trim(); if (s.length() > 0) { @@ -161,7 +160,6 @@ * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, * java.lang.String, org.xml.sax.Attributes) */ - @Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { // if there is a buffered start tag, write to the output if (!bufferStartTag.trim().isEmpty()) { @@ -199,7 +197,6 @@ * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, * java.lang.String) */ - @Override public void endElement(String namespaceURI, String localName, String qName) throws SAXException { bufferEndTag = "</" + qName + ">"; level--; @@ -222,7 +219,6 @@ * * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int) */ - @Override public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException { // empty } @@ -232,7 +228,6 @@ * * @see org.xml.sax.ContentHandler#processingInstruction(java.lang.String, java.lang.String) */ - @Override public void processingInstruction(String arg0, String arg1) throws SAXException { // empty } @@ -242,7 +237,6 @@ * * @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator) */ - @Override public void setDocumentLocator(Locator locator) { // empty } @@ -252,7 +246,6 @@ * * @see org.xml.sax.ContentHandler#endDocument() */ - @Override public void endDocument() throws SAXException { // empty } @@ -262,7 +255,6 @@ * * @see org.xml.sax.ContentHandler#startDocument() */ - @Override public void startDocument() throws SAXException { // empty } @@ -272,7 +264,6 @@ * * @see org.xml.sax.ContentHandler#skippedEntity(java.lang.String) */ - @Override public void skippedEntity(String name) throws SAXException { // empty } @@ -287,7 +278,6 @@ * * @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String, java.lang.String) */ - @Override public void startPrefixMapping(String prefix, String uri) throws SAXException { namespaceMappings.put(uri, prefix); } @@ -300,7 +290,6 @@ * * @see org.xml.sax.ContentHandler#endPrefixMapping(java.lang.String) */ - @Override public void endPrefixMapping(String prefix) throws SAXException { for (Iterator<String> i = namespaceMappings.keySet().iterator(); i.hasNext();) { Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java 2008-02-07 16:37:25 UTC (rev 40) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java 2008-02-08 14:55:32 UTC (rev 41) @@ -31,11 +31,13 @@ import java.io.PrintStream; import java.net.Socket; import java.net.SocketException; +import java.util.List; import de.dlr.davinspector.common.Constant; /** * TODO: wues_ha: Enter comment! + * TODO: Buffer in ChannelThread for in / outhoing messages * * @version $LastChangedRevision$ * @author Jochen Wuest @@ -49,11 +51,11 @@ /** * */ - private Socket inSock; + private Socket inputSocket; /** * */ - private Socket outSock; + private Socket outputSocket; /** * */ @@ -70,7 +72,7 @@ /** * */ - private PrintStream err; + private PrintStream errorPrintStream; /** * */ @@ -79,12 +81,12 @@ /** * */ - private String header; + private IRelayModel lock = null; /** - * + * */ - private IRelayModel lock = null; + private List<ChannelThread> connections; /** * TODO: wues_ha: enter comment! @@ -93,14 +95,15 @@ * @param outputSock Socket output socket * @param lockRef lock object * @param psErr Printstream for error messages - * @param bufferLockRef Object + * @param con List */ public ChannelThread(Socket inputSock, Socket outputSock, IRelayModel lockRef, - PrintStream psErr, Object bufferLockRef) { - this.inSock = inputSock; - this.outSock = outputSock; + PrintStream psErr, List<ChannelThread> con) { + this.inputSocket = inputSock; + this.outputSocket = outputSock; this.lock = lockRef; - this.err = psErr; + this.errorPrintStream = psErr; + this.connections = con; } /** @@ -108,33 +111,33 @@ * * @see java.lang.Thread#run() */ - @Override public void run() { byte[] buffer = new byte[Constant.PROXY_RECVBUFFERSIZE]; int count = Constant.EOF; try { - InputStream in = inSock.getInputStream(); + InputStream in = inputSocket.getInputStream(); +//# OutputStream out = outSock.getOutputStream(); try { count = in.read(buffer); while ((count != Constant.EOF) && !isInterrupted()) { +//# out.write(buf, 0, count); synchronized (lock) { lock.updateData(new String(buffer, 0, count, "utf-8"), toClient); lock.notifyListeners(toClient); } count = in.read(buffer); } -// synchronized (lock) { -// lock.notifyListeners(toClient); -// } } catch (IOException ioe) { - err.println(ioe); + errorPrintStream.println(tname + ioe); } finally { // The input and output streams will be closed when the sockets themselves are closed. +//# out.flush(); + errorPrintStream.println(tname + "flushing"); flushOut(); } } catch (IOException ioe) { - err.println(ioe); + errorPrintStream.println(tname + ioe); } synchronized (lock) { @@ -142,15 +145,20 @@ try { if ((peer == null) || peer.isDone()) { // Cleanup if there is only one peer OR if _both_ peers are done - inSock.close(); - outSock.close(); + inputSocket.close(); + outputSocket.close(); + errorPrintStream.println(tname + "closing"); } else { // Signal the peer (if any) that we're done on this side of the connection - flushOut(); +// flushOut(); + errorPrintStream.println(tname + "interrupting peer"); peer.interrupt(); } } catch (IOException ioe) { - err.println(header + COLON + ioe); + errorPrintStream.println(tname + COLON + ioe); + } finally { + errorPrintStream.println(tname + "removing connection"); + connections.remove(this); } } } @@ -176,10 +184,10 @@ /** * TODO: wues_ha: Enter comment! * - * @param peerSTC StreamCopyThread to peer to. + * @param peerChannelThread ChannelThread to peer to. */ - public void setPeer(ChannelThread peerSTC) { - this.peer = peerSTC; + public void setPeer(ChannelThread peerChannelThread) { + peer = peerChannelThread; } /** @@ -188,7 +196,7 @@ * @param threadName String thread name. */ public void setTName(String threadName) { - this.tname = threadName; + tname = threadName + ": "; } /** @@ -198,11 +206,11 @@ */ public void writeOut(String data) { try { - OutputStream out = outSock.getOutputStream(); + OutputStream out = outputSocket.getOutputStream(); out.write(data.getBytes()); out.flush(); } catch (IOException ioe) { - err.println(header + COLON + ioe); + errorPrintStream.println(tname + COLON + ioe); } } @@ -212,11 +220,11 @@ */ private void flushOut() { try { - outSock.getOutputStream().flush(); + outputSocket.getOutputStream().flush(); } catch (SocketException se) { - err.println(header + COLON + se); + errorPrintStream.println(tname + COLON + se); } catch (IOException ioe) { - err.println(header + COLON + ioe); + errorPrintStream.println(tname + COLON + ioe); } } @@ -228,4 +236,13 @@ public String getTName() { return tname; } + + /** + * TODO: wues_ha: Enter comment! + * + * @return Boolean + */ + public Boolean getDirection() { + return toClient; + } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-02-07 16:37:25 UTC (rev 40) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-02-08 14:55:32 UTC (rev 41) @@ -34,6 +34,7 @@ import java.net.Socket; import java.net.SocketException; import java.net.UnknownHostException; +import java.util.Iterator; import java.util.List; import java.util.Vector; @@ -60,60 +61,35 @@ /** * Address to forward connections to. */ - private InetAddress dstAddr; + private InetAddress destinationAddress; /** * Port to forward connections to. */ - private int dstPort; + private int destinationPort; /** * This proxy's server socket. */ - private ServerSocket srvSock; + private ServerSocket serverSocket; /** * Log stream for output messages. * TODO: to be deleted. */ - private PrintStream out; + private PrintStream outPrintStream; /** * Log stream for error messages. */ - private PrintStream err; + private PrintStream errorPrintStream; /** - * Lock object. + * Used for synchronizing ChannelThreads. */ - private Object clientLock = new Object(); + private Object lock = new Object(); /** - * Lock object. - */ - private Object serverLock = new Object(); - - /** - * Client to Server ChannelThread. - */ - private ChannelThread clientToServerChannel = null; - - /** - * Server to Client ChannelThread. - */ - private ChannelThread serverToClientChannel = null; - - /** - * Client socket. - */ - private Socket clientSocket; - - /** - * Server socket. - */ - private Socket serverSocket; - - /** * */ private String clientBuffer; @@ -124,6 +100,12 @@ private String serverBuffer; /** + * Contains all current connections (ChannelThreads). + */ + private List<ChannelThread> connections = new Vector<ChannelThread>(); + + + /** * TODO: wues_ha: enter comment! * */ @@ -208,19 +190,19 @@ InetAddress serverAddress = InetAddress.getByName(configuration.getClientAddress()); InetAddress clientAddress = InetAddress.getByName(configuration.getServerAddress()); - this.out = outStream; - this.err = errStream; + this.outPrintStream = outStream; + this.errorPrintStream = errStream; if (clientAddress == null) { - this.srvSock = new ServerSocket(configuration.getClientPort(), Constant.PROXY_BACKLOG); + this.serverSocket = new ServerSocket(configuration.getClientPort(), Constant.PROXY_BACKLOG); } else { - this.srvSock = new ServerSocket(configuration.getClientPort(), Constant.PROXY_BACKLOG, clientAddress); + this.serverSocket = new ServerSocket(configuration.getClientPort(), Constant.PROXY_BACKLOG, clientAddress); } - this.dstAddr = serverAddress; - this.dstPort = configuration.getServerPort(); + this.destinationAddress = serverAddress; + this.destinationPort = configuration.getServerPort(); } catch (UnknownHostException uhe) { - err.println(uhe); + errorPrintStream.println(uhe); } catch (IOException ioe) { - err.println(ioe); + errorPrintStream.println(ioe); } start(); } @@ -231,60 +213,71 @@ * @see java.lang.Thread#run() */ public void run() { - out.println("starting"); + outPrintStream.println("starting"); try { while (!isInterrupted()) { - serverSocket = srvSock.accept(); + Socket serverSideSocket = serverSocket.accept(); try { clientBuffer = ""; serverBuffer = ""; - serverSocket.setSoLinger(true, Constant.PROXY_LINGERTIME); - clientSocket = new Socket(dstAddr, dstPort); - clientSocket.setSoLinger(true, Constant.PROXY_LINGERTIME); - serverToClientChannel = new ChannelThread(serverSocket, clientSocket, (IRelayModel) this, err, clientLock); - clientToServerChannel = new ChannelThread(clientSocket, serverSocket, (IRelayModel) this, err, serverLock); + serverSideSocket.setSoLinger(true, Constant.PROXY_LINGERTIME); + Socket clientSideSocket = new Socket(destinationAddress, destinationPort); + clientSideSocket.setSoLinger(true, Constant.PROXY_LINGERTIME); + ChannelThread serverToClientChannel = new ChannelThread(serverSideSocket, clientSideSocket, + (IRelayModel) this, errorPrintStream, connections); + ChannelThread clientToServerChannel = new ChannelThread(clientSideSocket, serverSideSocket, + (IRelayModel) this, errorPrintStream, connections); serverToClientChannel.setPeer(clientToServerChannel); - serverToClientChannel.setTName("sToC"); - serverToClientChannel.setToClient(true); clientToServerChannel.setPeer(serverToClientChannel); - clientToServerChannel.setTName("cToS"); + serverToClientChannel.setToClient(true); clientToServerChannel.setToClient(false); - serverToClientChannel.start(); - clientToServerChannel.start(); + serverToClientChannel.setTName("ServerToClientThread"); + clientToServerChannel.setTName("ClientToServerThread"); + synchronized (lock) { + connections.add(clientToServerChannel); + connections.add(serverToClientChannel); + serverToClientChannel.start(); + clientToServerChannel.start(); + } } catch (SocketException se) { - err.println(se); + errorPrintStream.println(se); } } - srvSock.close(); + serverSocket.close(); } catch (IOException ioe) { - err.println(ioe); + errorPrintStream.println(ioe); } finally { cleanup(); - out.println("stopped"); + outPrintStream.println("stopped"); } } + /** * TODO: wues_ha: Enter comment! * FIXME: stopping */ public void stopRelay() { - this.interrupt(); - out.println("stopping ..."); + interrupt(); + + outPrintStream.println("stopping ..."); } /** * All StreamCopyThreads are interrupted and joined. */ private void cleanup() { - out.println("stopping .."); - try { - clientToServerChannel.interrupt(); - serverToClientChannel.interrupt(); - clientToServerChannel.join(Constant.PROXY_THREADTIMEOUT); - serverToClientChannel.join(Constant.PROXY_THREADTIMEOUT); - } catch (InterruptedException ie) { - err.println(ie); + synchronized (lock) { + outPrintStream.println("stopping .."); + try { + while (connections.size() > 0) { + ChannelThread channelThread = (ChannelThread) connections.get(0); + channelThread.interrupt(); + channelThread.join(Constant.PROXY_THREADTIMEOUT); + } + } catch (InterruptedException ie) { + errorPrintStream.println(ie); + } } } @@ -337,49 +330,41 @@ outStream.write(buffer.getBytes()); outStream.flush(); } catch (IOException ioe) { - err.println(ioe); + errorPrintStream.println(ioe); } } } /** + * TODO: wues_ha: Enter comment! + * + * @param data String + * @param toClient Boolean + */ + private void write(String data, Boolean toClient) { + for (ChannelThread connection : connections) { + if (connection.getDirection() != toClient) { + connection.writeOut(data); + } + } + } + + /** * Writes data to the Client. * * @param data String data to write to the client. */ public void writeToClient(String data) { - try { - if (serverSocket != null) { - OutputStream outStream = serverSocket.getOutputStream(); - if (isChunked(data)) { - sendChunkedData(outStream, data); - } else { - outStream.write(data.getBytes()); - } - } - } catch (IOException ioe) { - err.println(ioe); - } + write(data, true); } - + /** * Writes Data to the Server. * * @param data String data to write to the server. */ public void writeToServer(String data) { - try { - if (clientSocket != null) { - OutputStream outStream = clientSocket.getOutputStream(); - if (isChunked(data)) { - sendChunkedData(outStream, data); - } else { - outStream.write(data.getBytes()); - } - } - } catch (IOException ioe) { - err.println(ioe); - } + write(data, false); } /** Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-07 16:37:25 UTC (rev 40) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-08 14:55:32 UTC (rev 41) @@ -547,7 +547,7 @@ jFrame.setContentPane(getJContentPane()); jFrame.setJMenuBar(getJJMenuBar()); jFrame.setTitle(Constant.APP_TITLE + " " + Constant.APP_VERSION); - jFrame.setIconImage(UIResource.getIcon(UIResource.ICON_APP16).getImage()); + jFrame.setIconImage(UIResource.getIcon(UIResource.ICON_APP32).getImage()); jFrame.addWindowListener(new java.awt.event.WindowAdapter() { Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationTableModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationTableModel.java 2008-02-07 16:37:25 UTC (rev 40) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationTableModel.java 2008-02-08 14:55:32 UTC (rev 41) @@ -58,7 +58,6 @@ * * @see javax.swing.table.TableModel#getColumnCount() */ - @Override public int getColumnCount() { return columnNames.length; } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/UIResource.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/UIResource.java 2008-02-07 16:37:25 UTC (rev 40) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/UIResource.java 2008-02-08 14:55:32 UTC (rev 41) @@ -103,11 +103,6 @@ /** * */ - public static final String ICON_APP16 = "inspector16.png"; - - /** - * - */ public static final String ICON_APP32 = "inspector32.png"; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-07 16:37:27
|
Revision: 40 http://davinspector.svn.sourceforge.net/davinspector/?rev=40&view=rev Author: wuest Date: 2008-02-07 08:37:25 -0800 (Thu, 07 Feb 2008) Log Message: ----------- rework of folder names and files Added Paths: ----------- trunk/DAVInspector/src/de/ trunk/DAVInspector/src/de/dlr/ trunk/DAVInspector/src/de/dlr/davinspector/ trunk/DAVInspector/src/de/dlr/davinspector/DAVInspector.java trunk/DAVInspector/src/de/dlr/davinspector/common/ trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java trunk/DAVInspector/src/de/dlr/davinspector/common/Util.java trunk/DAVInspector/src/de/dlr/davinspector/common/package.html trunk/DAVInspector/src/de/dlr/davinspector/configuration/ trunk/DAVInspector/src/de/dlr/davinspector/configuration/Configuration.java trunk/DAVInspector/src/de/dlr/davinspector/configuration/package.html trunk/DAVInspector/src/de/dlr/davinspector/history/ trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java trunk/DAVInspector/src/de/dlr/davinspector/history/package.html trunk/DAVInspector/src/de/dlr/davinspector/http/ trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessage.java trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMethod.java trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPStatusCode.java trunk/DAVInspector/src/de/dlr/davinspector/http/package.html trunk/DAVInspector/src/de/dlr/davinspector/package.html trunk/DAVInspector/src/de/dlr/davinspector/plugin/ trunk/DAVInspector/src/de/dlr/davinspector/plugin/IEditPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/IViewPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/package.html trunk/DAVInspector/src/de/dlr/davinspector/plugins/ trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/ trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/package.html trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLTextPane.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/package.html trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/JTreeContentHandler.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreeView.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/package.html trunk/DAVInspector/src/de/dlr/davinspector/relay/ trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java trunk/DAVInspector/src/de/dlr/davinspector/relay/IClientListener.java trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java trunk/DAVInspector/src/de/dlr/davinspector/relay/IServerListener.java trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java trunk/DAVInspector/src/de/dlr/davinspector/relay/package.html trunk/DAVInspector/src/de/dlr/davinspector/ui/ trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/IMainController.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainController.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationTableModel.java trunk/DAVInspector/src/de/dlr/davinspector/ui/UIResource.java trunk/DAVInspector/src/de/dlr/davinspector/ui/package.html Added: trunk/DAVInspector/src/de/dlr/davinspector/DAVInspector.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/DAVInspector.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/DAVInspector.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,65 @@ +/* + * DAVInspector.java + * + * DAVInspector main class. + * + * Created: 22.01.2008 wues_ha <email> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector; + +import de.dlr.davinspector.relay.IRelayModel; +import de.dlr.davinspector.relay.RelayModel; +import de.dlr.davinspector.ui.MainController; + + +/** + * TODO: wues_ha: Enter comment! + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public final class DAVInspector { + + /** + * Hide utility class constructor. + */ + private DAVInspector() { } + + /** + * TODO: wues_ha: Enter comment! + * + * @param args String[] + */ + public static void main(String[] args) { + // FIXME: History Table not working + // FIXME: Debug notifier + // FIXME: stop service + // TODO: automatic end of message detection + + //Locale loc = Locale.getDefault(); + //Locale loc = Locale.GERMANY; + //Locale loc = Locale.US; + //ResourceBundle resourceBundle = ResourceBundle.getBundle("DAVInspectorLang", loc); + + IRelayModel model = new RelayModel(); + new MainController(model); + } +} Added: trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,181 @@ +/* + * Constant.java + * + * Definition of all needed constants. + * + * Created: 11.10.2007 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.common; + +import java.awt.Color; + + +/** + * Constants. + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public final class Constant { + + /** + * GUI Width. + */ + public static final int UI_MAIN_WINDOW_WIDTH = 800; + + /** + * GUI Height. + */ + public static final int UI_MAIN_WINDOW_HEIGHT = 600; + + /** + * Configuration Dialog Width. + */ + public static final int UI_CONFIG_DIALOG_WIDTH = 300; + + /** + * Configuration Dialog Height. + */ + public static final int UI_CONFIG_DIALOG_HEIGHT = 200; + + /** + * + */ + public static final int UI_PLUGIN_CONFIG_DIALOG_WIDTH = 650; + + /** + * + */ + public static final int UI_PLUGIN_CONFIG_DIALOG_HEIGTH = 250; + + /** + * + */ + public static final int UI_ABOUT_DIALOG_WIDTH = 250; + + /** + * + */ + public static final int UI_ABOUT_DIALOG_HEIGTH = 175; + + /** + * + */ + public static final Color UI_REPLY_COLOR = new Color(255, 204, 102); + + /** + * + */ + public static final Color UI_REQUEST_COLOR = new Color(170, 240, 240); + + /** + * Line Feed + Carriage Return. + */ + public static final String LFCR = "\r\n"; + + /** + * Line Feed. + */ + public static final String LF = "\r"; + + /** + * Carriage Return. + */ + public static final String CR = "\n"; + + /** + * EOF. + */ + public static final int EOF = -1; + + /** + * Application Title. + */ + public static final String APP_TITLE = "DAVInspector"; + + /** + * Filename of the configuration file. + */ + public static final String APP_VERSION = "0.1"; + + /** + * Filename of the configuration file. + */ + public static final String CONFIGURATION_FILENAME = "config.properties"; + + /** + * Timeout waiting for a StreamCopyThread to finish in ms. + */ + public static final int PROXY_THREADTIMEOUT = 100; + + /** + * Linger time in seconds for socket. + */ + public static final int PROXY_LINGERTIME = 5; + + /** + * Size of the receive buffer. + */ + public static final int PROXY_RECVBUFFERSIZE = 1024; + + /** + * Backlog parameter used when creating the ServerSocket. + */ + public static final int PROXY_BACKLOG = 100; + + /** + * Address of the Server. IP address or domain name. + */ + public static final String PROXY_SERVERADDRESS = "localhost"; //"bsasdf01.as.bs.dlr.de"; + + /** + * Server port. + */ + public static final int PROXY_SERVERPORT = 8080; + + /** + * Address of the Client. Normally this is empty and + * the address of the client is of no importance. + */ + public static final String PROXY_CLIENTADDRESS = ""; + + /** + * Client port. + */ + public static final int PROXY_CLIENTPORT = 8888; + + /** + * + */ + public static final String PLUGIN_CLASSPATH = "de.dlr.davinspector.plugins."; + + /** + * + */ + public static final String RESOURCE_PATH = "/de/dlr/davinspector/resource/"; + + /** + * TODO: wues_ha: enter comment! + * + */ + private Constant() { + + } +} Added: trunk/DAVInspector/src/de/dlr/davinspector/common/Util.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/common/Util.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/common/Util.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,87 @@ +/* + * Util.java + * + * Utility functions. + * + * Created: 04.02.2008 HJW <email> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.common; + +import java.awt.Dimension; +import java.awt.Toolkit; +import java.awt.Window; + +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; + + +/** + * TODO: HJW: Enter comment! + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public final class Util { + + /** + * TODO: HJW: enter comment! + * + */ + private Util() { + + } + + /** + * TODO: HJW: Enter comment! + * + */ + public static void setUIDesign() { + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (UnsupportedLookAndFeelException lfe) { + System.err.println(lfe); + } catch (IllegalAccessException iae) { + System.err.println(iae); + } catch (InstantiationException ie) { + System.err.println(ie); + } catch (ClassNotFoundException cnfe) { + System.err.println(cnfe); + } + } + + /** + * TODO: HJW: Enter comment! + * + * @param window Window + */ + public static void centerWindow(Window window) { + // Center the window + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + Dimension windowSize = window.getSize(); + if (windowSize.height > screenSize.height) { + windowSize.height = screenSize.height; + } + if (windowSize.width > screenSize.width) { + windowSize.width = screenSize.width; + } + window.setLocation((screenSize.width - windowSize.width) / 2, (screenSize.height - windowSize.height) / 2); + } +} Added: trunk/DAVInspector/src/de/dlr/davinspector/common/package.html =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/common/package.html (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/common/package.html 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,12 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" +"http://www.w3.org/TR/REC-html40/loose.dtd"> + +<html><head><title>BLUB B</title></head><body> + +BLUB B + +<h2>Package Specification</h2> + +BLUB B + +</body></html> \ No newline at end of file Added: trunk/DAVInspector/src/de/dlr/davinspector/configuration/Configuration.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/configuration/Configuration.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/configuration/Configuration.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,281 @@ +/* + * Configuration.java + * + * This Class stores the configuration of the DAVInspector. + * + * Created: 21.12.2007 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.configuration; + +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; +import java.util.Properties; +import java.util.Vector; + +import de.dlr.davinspector.common.Constant; +import de.dlr.davinspector.plugin.IPlugin; + + +/** + * TODO: wues_ha: Enter comment! + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public class Configuration { + + /** + * + */ + private Properties properties; + + /** + * Port number of the server connection. + */ + private int serverPort; + + /** + * Port number of the client connection. + */ + private int clientPort; + + /** + * Address of the server. + */ + private String serverAddress; + + /** + * Address of the client. + */ + private String clientAddress; + + /** + * This list contains all available plugins that let you edit the traffic. + */ + private List<IPlugin> availableEditPlugins; + + /** + * This list contains all available plugins that let you view the traffic. + */ + private List<IPlugin> availableViewPlugins; + + /** + * This list contains all plugins to view the traffic to the server. + */ + private List<IPlugin> activeViewPluginsToServer; + + /** + * This list contains all plugins to view the traffic to the client. + */ + private List<IPlugin> activeViewPluginsToClient; + + /** + * This list contains all plugins to edit the traffic to the server. + */ + private List<IPlugin> activeEditPluginsToServer; + + /** + * This list contains all plugins to edit the traffic to the server. + */ + private List<IPlugin> activeEditPluginsToClient; + + /** + * TODO: wues_ha: enter comment! + * + */ + public Configuration() { + loadConfiguration(); + + availableEditPlugins = new Vector<IPlugin>(); + availableViewPlugins = new Vector<IPlugin>(); + // TODO: Load available plugins + + activeViewPluginsToServer = new Vector<IPlugin>(); + activeViewPluginsToClient = new Vector<IPlugin>(); + activeEditPluginsToServer = new Vector<IPlugin>(); + activeEditPluginsToClient = new Vector<IPlugin>(); + } + + /** + * TODO: wues_ha: Enter comment! + * + * @return Vector + */ + public List<IPlugin> getAvailableEditPlugins() { + return availableEditPlugins; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @return Vector + */ + public List<IPlugin> getAvailableViewPlugins() { + return availableViewPlugins; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @return Vector + */ + public List<IPlugin> getActiveViewPluginsToServer() { + return activeViewPluginsToServer; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @return Vector + */ + public List<IPlugin> getActiveViewPluginsToClient() { + return activeViewPluginsToClient; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @return Vector + */ + public List<IPlugin> getActiveEditPluginsToServer() { + return activeEditPluginsToServer; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @return Vector + */ + public List<IPlugin> getActiveEditPluginsToClient() { + return activeEditPluginsToClient; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @return String with address of the server + */ + public String getServerAddress() { + return serverAddress; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @return Integer Server port + */ + public int getServerPort() { + return serverPort; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @return String with address of the server + */ + public String getClientAddress() { + return clientAddress; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @return Integer Server port + */ + public int getClientPort() { + return clientPort; + } + + /** + * TODO: wues_ha: Enter comment! + * + */ + public void loadConfiguration() { + properties = new Properties(); + try { + properties.load(new FileInputStream(Constant.CONFIGURATION_FILENAME)); + // assign properties to variables + serverAddress = properties.getProperty("ServerAddress", Constant.PROXY_SERVERADDRESS); + serverPort = Integer.parseInt(properties.getProperty("ServerPort", String.valueOf(Constant.PROXY_SERVERPORT))); + clientAddress = properties.getProperty("ClientAddress", Constant.PROXY_CLIENTADDRESS); + clientPort = Integer.parseInt(properties.getProperty("ClientPort", String.valueOf(Constant.PROXY_CLIENTPORT))); + + } catch (IOException ioe) { + System.err.println(ioe); + } + } + + /** + * TODO: wues_ha: Enter comment! + * + */ + public void storeConfiguration() { + // save variables in properties + properties.setProperty("ServerAddress", serverAddress); + properties.setProperty("ServerPort", String.valueOf(serverPort)); + properties.setProperty("ClientAddress", clientAddress); + properties.setProperty("ClientPort", String.valueOf(clientPort)); + + try { + properties.store(new FileOutputStream(Constant.CONFIGURATION_FILENAME), null); + } catch (IOException ioe) { + System.err.println(ioe); + } + } + + /** + * TODO: wues_ha: Enter comment! + * + * @param serverAddressC server address + */ + public void setServerAddress(String serverAddressC) { + this.serverAddress = serverAddressC; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @param clientAddressC client address + */ + public void setClientAddress(String clientAddressC) { + this.clientAddress = clientAddressC; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @param serverPortC server port + */ + public void setServerPort(String serverPortC) { + this.serverPort = Integer.parseInt(serverPortC); + } + + /** + * TODO: wues_ha: Enter comment! + * + * @param clientPortC client port + */ + public void setClientPort(String clientPortC) { + this.clientPort = Integer.parseInt(clientPortC); + } +} Added: trunk/DAVInspector/src/de/dlr/davinspector/configuration/package.html =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/configuration/package.html (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/configuration/package.html 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,12 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" +"http://www.w3.org/TR/REC-html40/loose.dtd"> + +<html><head><title>BLUB B</title></head><body> + +BLUB B + +<h2>Package Specification</h2> + +BLUB B + +</body></html> \ No newline at end of file Added: trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,92 @@ +/* + * HistoryTableCellRenderer.java + * + * This class renders the history table cells (colors, direction, etc.). + * + * Created: 21.01.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.history; + +import java.awt.Color; +import java.awt.Component; + +import javax.swing.JTable; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.TableCellRenderer; + +import de.dlr.davinspector.common.Constant; + + +/** + * TODO: wues_ha: Enter comment! + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public class HistoryTableCellRenderer extends DefaultTableCellRenderer implements TableCellRenderer { + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * + */ + private Boolean isRequest = false; + + /** + * {@inheritDoc} + * + * @see javax.swing.table.DefaultTableCellRenderer#getTableCellRendererComponent + * (javax.swing.JTable, java.lang.Object, boolean, boolean, int, int) + */ + public Component getTableCellRendererComponent(JTable table, Object value, + boolean isSelected, boolean hasFocus, int row, int column) { + super.getTableCellRendererComponent(table, value, isSelected, + hasFocus, row, column); + + if (value instanceof Boolean){ + isRequest = ((Boolean) value).booleanValue(); + if (isRequest) { + setText("Request"); + } else { + setText("Reply"); + } + } else { + setText(value.toString()); + } + + if (hasFocus || isSelected) { + setForeground(Color.getColor("textHighlighttext")); + setBackground(Color.getColor("textHighlight")); + } else { + setForeground(Color.getColor("windowText")); + if (isRequest) { + setBackground(Constant.UI_REQUEST_COLOR); + } else { + setBackground(Constant.UI_REPLY_COLOR); + } + } + + return this; + } +} Added: trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,80 @@ +/* + * HistoryTableModel.java + * + * Data model for the history table. + * + * Created: 15.01.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.history; + +import javax.swing.table.DefaultTableModel; + +/** + * TODO: wues_ha: Enter comment! + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public class HistoryTableModel extends DefaultTableModel { + + /** + * + */ + private static final long serialVersionUID = 0L; + + /** + * + */ + private String[] columnNames = { + "Type", + "ID", + "Timestamp", + "Size" + }; + + /** + * {@inheritDoc} + * + * @see javax.swing.table.TableModel#getColumnCount() + */ + @Override + public int getColumnCount() { + return columnNames.length; + } + + /** + * {@inheritDoc} + * + * @see javax.swing.table.AbstractTableModel#getColumnName(int) + */ + public String getColumnName(int col) { + return columnNames[col]; + } + + /** + * {@inheritDoc} + * + * @see javax.swing.table.AbstractTableModel#isCellEditable(int, int) + */ + public boolean isCellEditable(int row, int col) { + return false; + } +} Added: trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,179 @@ +/* + * Message.java + * + * Representation of a message. + * + * Created: 15.01.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.history; + +import java.util.Date; + + +/** + * TODO: wues_ha: Enter comment! + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public class Message { + /** + * + */ + private static int idCounter; + + /** + * TODO: wues_ha: Enter comment! + * + * @version $LastChangedRevision$ + * @author wues_ha + */ + public enum MessageType { + /** + * + */ + Request, + /** + * + */ + Response + } + + /** + * + */ + private int id; + + /** + * + */ + private Date timestamp; + + /** + * + */ + private MessageType type; + + /** + * + */ + private String data; + + /** + * + */ + private int size; + + /** + * TODO: wues_ha: enter comment! + * + */ + public Message() { + ++idCounter; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @return id + */ + public int getId() { + return id; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @return timestamp + */ + public Date getTimestamp() { + return timestamp; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @param ts Date/Timestamp + */ + public void setTimestamp(Date ts) { + this.timestamp = ts; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @return toClient + */ + public MessageType getMessageType() { + return type; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @param t MessageType + */ + public void setMessageType(MessageType t) { + this.type = t; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @param toClient Boolean + */ + public void setMessageType(Boolean toClient) { + if (toClient) { + this.type = MessageType.Response; + } else { + this.type = MessageType.Request; + } + } + + /** + * TODO: wues_ha: Enter comment! + * + * @return data + */ + public String getData() { + return data; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @param msg String + */ + public void setData(String msg) { + this.data = msg; + this.size = msg.length(); + this.id = idCounter; + } + + /** + * TODO: wues_ha: Enter comment! + * + * @return size + */ + public int getSize() { + return size; + } +} Added: trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,101 @@ +/* + * MessageHistory.java + * + * This class stores the messages and provides access to recorded messages. + * + * Created: 30.01.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.history; + +import java.util.Date; +import java.util.List; +import java.util.Vector; + + +/** + * This class saves and provides access + * to the processed messages. + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public class MessageHistory { + + /** + * + */ + private List<Message> messages = null; + + /** + * TODO: wues_ha: enter comment! + * + */ + public MessageHistory() { + messages = new Vector<Message>(); + } + + /** + * TODO: wues_ha: Enter comment! + * + * @param data String + * @param toClient Boolean + * @param ts Date + */ + public void storeMessage(String data, Boolean toClient, Date ts) { + // store Message + Message msg = new Message(); + msg.setMessageType(toClient); + msg.setData(data); + msg.setTimestamp(new Date()); + messages.add(msg); + + //update history table + //myTableModel.addRow(new Object[]{msg.getClientToSever(), msg.getId(), msg.getTimestamp(), msg.getSize()}); + //myTableModel.fireTableDataChanged(); + + //update plugins + //List<Plugin> plugged = pluginManager.getAvailablePlugins(); + //for (Iterator<Plugin> iterator = plugged.iterator(); iterator.hasNext();) { + //Plugin plugin = (Plugin) iterator.next(); + //plugin.update(data); + //} + } + + /** + * TODO: wues_ha: Enter comment! + * + * @param idx int + * @return Message + */ + public Message getMessage(int idx) { + return new Message(); + } + + /** + * TODO: wues_ha: Enter comment! + * + * @param id int + * @return Message + */ + public Message getMessageById(int id) { + return new Message(); + } +} Added: trunk/DAVInspector/src/de/dlr/davinspector/history/package.html =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/package.html (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/package.html 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,12 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" +"http://www.w3.org/TR/REC-html40/loose.dtd"> + +<html><head><title>BLUB B</title></head><body> + +BLUB B + +<h2>Package Specification</h2> + +BLUB B + +</body></html> \ No newline at end of file Added: trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessage.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessage.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessage.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,104 @@ +/* + * HTTPMessage.java + * + * TODO: wues_ha Enter comment! + * + * Created: 23.01.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.http; + + +/** + * TODO: wues_ha: Enter comment! + * ##{@link #addData(String)}interface?? + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public class HTTPMessage { + // CHECKSTYLE:OFF + /** + * TODO: wues_ha: Enter comment! + */ + public enum MessageType { + Request, + Response + } + + private String msg; + private String header; + private String body; + private MessageType type; + private Boolean isComplete; + + public HTTPMessage() { + + } + + //### evtl stream + public HTTPMessage(String data) { + + } + + public void addData(String data) { + + } + + // TODO: header auseinandernehmen (REQ-RES/LEN/ENC) + // TODO: body zusammenstellen + // TODO: StringTokenizer + private void processMessage() { + String result = ""; + + // HTTP/1.1 HTTP/1.0 HTTP/0.9 + // TODO: split input into different HTTP messages + //String[] httpMessages = input.split("HTTP/[1.1|1.0|0.9]{1}"); + + // TODO: nur die erste Nachricht wird angezeigt + //input = httpMessages[0]; + + String[] s = msg.split("\r\n\r\n"); + header = s[0]; + for (int i = 1; i < s.length; i++) { + result = s[i]; + } + + + // detect and process chunked data + // split the input in the different chunks. + // each chunk starts with the length of the chunk in hex. + String[] lines = result.split("(\r\n[0-9a-fA-F]+\r\n)"); + result = ""; + for (int i = 0; i < lines.length; i++) { + result += lines[i]; + } + + } + + // TODO: Col/vec o.\xE4. + public String getHeader() { + return header; + } + + public String getBody() { + return body; + } + // CHECKSTYLE:ON +} Added: trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMethod.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMethod.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMethod.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,60 @@ +/* + * HTTPMethod.java + * + * TODO: wues_ha Enter comment! + * + * Created: 23.01.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.http; + + +/** + * HTTP methodes according to + * RFC2616 (HTTP1.1) and RFC 4918 (WebDAV). + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public class HTTPMethod { + // CHECKSTYLE:OFF + /* + * HTTP methods + */ + public enum HttpMethod { + UNKNOWN, + HEAD, + GET, + POST, + PUT, + DELETE, + OPTIONS, + TRACE, + CONNECT, + PROPFIND, + PROPPATCH, + MKCOL, + COPY, + MOVE, + LOCK, + UNLOCK + } +// CHECKSTYLE:ON +} Added: trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPStatusCode.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPStatusCode.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPStatusCode.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,110 @@ +/* + * HTTPStatusCode.java + * + * TODO: wues_ha Enter comment! + * + * Created: 23.01.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.http; + +/** + * HTTP status codes according to + * RFC2616 (HTTP1.1) and RFC 4918 (WebDAV). + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public final class HTTPStatusCode { +// CHECKSTYLE:OFF + /* + * 1xx: Informational - Request received, continuing process + */ + public static final int HTTP_CONTINUE = 100; + public static final int HTTP_SWITCHING_PROTOCOLS = 101; + + /* + * 2xx: Success - The action was successfully received, understood, and accepted + */ + public static final int HTTP_OK = 200; + public static final int HTTP_CREATED = 201; + public static final int HTTP_ACCEPTED = 202; + public static final int HTTP_NON_AUTHORITATIVE_INFORMATION = 203; + public static final int HTTP_NO_CONTENT = 204; + public static final int HTTP_RESET_CONTENT = 205; + public static final int HTTP_PARTIAL_CONTENT = 206; + public static final int HTTP_MULTISTATUS = 207; + + /* + * 3xx: Redirection - Further action must be taken in order to complete the request + */ + public static final int HTTP_MULTIPLE_CHOICES = 300; + public static final int HTTP_MOVED_PERMANENTLY = 301; + public static final int HTTP_FOUND = 302; + public static final int HTTP_SEE_OTHER = 303; + public static final int HTTP_NOT_MODIFIED = 304; + public static final int HTTP_USE_PROXY = 305; + public static final int HTTP_TEMPORARY_REDIRECT = 306; + + /* + * 4xx: Client Error - The request contains bad syntax or cannot be fulfilled + */ + public static final int HTTP_BAD_REQUEST = 400; + public static final int HTTP_UNAUTHORIZED = 401; + public static final int HTTP_PAYMENT_REQUIRED = 402; + public static final int HTTP_FORBIDDEN = 403; + public static final int HTTP_NOT_FOUND = 404; + public static final int HTTP_METHOD_NOT_ALLOWED = 405; + public static final int HTTP_NOT_ACCEPTABLE = 406; + public static final int HTTP_PROXY_AUTHENTICATION_REQUIRED = 407; + public static final int HTTP_REQUEST_TIME_OUT = 408; + public static final int HTTP_CONFLICT = 409; + public static final int HTTP_GONE = 410; + public static final int HTTP_LENGTH_REQUIRED = 411; + public static final int HTTP_PRECONDITION_FAILED = 412; + public static final int HTTP_REQUEST_ENTITY_TOO_LARGE = 413; + public static final int HTTP_REQUEST_URI_TOO_LARGE = 414; + public static final int HTTP_UNSUPPORTED_MEDIA_TYPE = 415; + public static final int HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416; + public static final int HTTP_EXPECTATION_FAILED = 417; + public static final int HTTP_UNPROCESSABLE_ENTITY = 422; + public static final int HTTP_LOCKED = 423; + public static final int HTTP_FAILED_DEPENDENCY = 424; + + /* + * 5xx: Server Error - The server failed to fulfill an apparently valid request + */ + public static final int HTTP_INTERNAL_SERVER_ERROR = 500; + public static final int HTTP_NOT_IMPLEMENTED = 501; + public static final int HTTP_BAD_GATEWAY = 502; + public static final int HTTP_SERVICE_UNAVAILABLE = 503; + public static final int HTTP_GATEWAY_TIEMOUT = 504; + public static final int HTTP_HTTP_VERSION_NOT_SUPPORTED = 505; + public static final int HTTP_INSUFFICIENT_STORAGE = 507; +// CHECKSTYLE:ON + + /** + * TODO: HJW: enter comment! + * + */ + private HTTPStatusCode() { + + } +} Added: trunk/DAVInspector/src/de/dlr/davinspector/http/package.html =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/http/package.html (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/http/package.html 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,12 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" +"http://www.w3.org/TR/REC-html40/loose.dtd"> + +<html><head><title>BLUB B</title></head><body> + +BLUB B + +<h2>Package Specification</h2> + +BLUB B + +</body></html> \ No newline at end of file Added: trunk/DAVInspector/src/de/dlr/davinspector/package.html =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/package.html (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/package.html 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,12 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" +"http://www.w3.org/TR/REC-html40/loose.dtd"> + +<html><head><title>BLUB B</title></head><body> + +BLUB B + +<h2>Package Specification</h2> + +BLUB B + +</body></html> \ No newline at end of file Added: trunk/DAVInspector/src/de/dlr/davinspector/plugin/IEditPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/IEditPlugin.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/IEditPlugin.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,46 @@ +/* + * IEditPlugin.java + * + * This interface has to be implemented by plugins which allow the user to edit + * the traffic. + * + * Created: 17.01.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.plugin; + + + +/** + * TODO: wues_ha: Enter comment! + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public interface IEditPlugin extends IPlugin { + /** + * Returns the processed data of the plugin. + * + * @return String + */ + String getOutput(); + + //### klasse!? -> verarbeitungsreihenfolge +} Added: trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,129 @@ +/* + * IPlugin.java + * + * General interface for plugins. + * + * Created: 17.01.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.plugin; + + +/** + * TODO: wues_ha: Enter comment! + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public interface IPlugin { + /** + * Returns the version of the plugin. + * + * @return int with version information + */ + int getVersion(); + + /** + * Returns the type of the plugin. + * client/server + * view/edit + * + * @return string + */ + PlugInType getType(); + + /** + * Returns the name of the plugin. + * + * @return String + */ + String getName(); + + /** + * Returns the name of the author of the plugin. + * + * @return String + */ + String getAuthor(); + + /** + * Returns the description of the plugin. + * + * @return String + */ + String getDescription(); + + /** + * Initializes the plugin. + * + */ + void init(); + + /** + * Starts processing of the data. + * + * @param data String + */ + void update(String data); + + /** + * Enable/disable the plugin. + * + * @param state Boolean + */ + void setActive(Boolean state); + + /** + * Returns the current state of the plugin. + * + * @return Boolean + */ + Boolean isActive(); + + /** + * Indentifier for plugin-type. + */ + public enum PlugInType { + /** + * + */ + VIEW_GENERAL, + /** + * + */ + EDIT_GENERAL, + /** + * + */ + VIEW_CLIENT, + /** + * + */ + VIEW_SERVER, + /** + * + */ + EDIT_CLIENT, + /** + * + */ + EDIT_SERVER + } +} Added: trunk/DAVInspector/src/de/dlr/davinspector/plugin/IViewPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/IViewPlugin.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/IViewPlugin.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,45 @@ +/* + * IViewPlugin.java + * + * Interface which has to be implemented by plugins with visual components. + * + * Created: 17.01.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.plugin; + +import javax.swing.JComponent; + + + +/** + * TODO: wues_ha: Enter comment! + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public interface IViewPlugin extends IPlugin { + /** + * Returns the JComponent of the plugin. + * + * @return JComponent + */ + JComponent getUI(); +} Added: trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,137 @@ +/* + * PluginManager.java + * + * This class handles the available plugins. + * + * Created: 17.01.2008 Markus Litz <Mar...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.plugin; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Vector; + +import de.dlr.davinspector.common.Constant; + +/** + * TODO: wues_ha: Enter comment! + * Fast and thread safe implementation of the Singleton pattern. + * + * @version $LastChangedRevision$ + * @author Markus Litz + * @author Jochen Wuest + */ +public final class PluginManager { + /** + * + */ + private static PluginManager instance = new PluginManager(); + + /** + * + */ + private Map<String, URLClassLoader> loaderHashmap = new HashMap<String, URLClassLoader>(); + + /** + * + */ + private List<IPlugin> pluginVector = new Vector<IPlugin>(); + + /** + * Default constructor, + * not callable from outside this class. + */ + private PluginManager() {} + + /** + * Static method, returns the only instance of this class. + * + * @return PluginManager + */ + public static PluginManager getInstance() { + return instance; + } + + /** + * TODO: wues_ha: Enter comment! + * + */ + public void loadAllPlugins() { + //\xFCber jar-dateien im plugin-verzeichnis iterieren + // TODO: filter f\xFCr jar dateien + System.err.println("loading plugins ..."); + File pluginVZ = new File("plugins"); + if (pluginVZ.isDirectory()) { + String[] fils = pluginVZ.list(); + String pathToPluginDir = pluginVZ.getAbsolutePath(); + //foreach + for (int i = 0; i < fils.length; ++i) { + File plug = new File(pathToPluginDir + "/" + fils[i]); + loadPlugin(plug.getAbsoluteFile()); + } + } + } + + /** + * + * load a plugin from a given Java-File-var. + * + * @param jarfile File + */ + public void loadPlugin(File jarfile) { + IPlugin plugin = null; + String name = jarfile.getName().substring(0, jarfile.getName().lastIndexOf(".")); + try { + URLClassLoader jcl = new URLClassLoader(new URL[] { jarfile.toURI().toURL() }); + Class<?> c = jcl.loadClass(Constant.PLUGIN_CLASSPATH + name.toLowerCase() + "." + name); + // lets try to load plugin... + plugin = (IPlugin) c.newInstance(); + plugin.init(); + // ok, the plugin is initialized + if (plugin != null) { + pluginVector.add(plugin); + loaderHashmap.put(name, jcl); + } + } catch (ClassNotFoundException cnfe) { + System.err.println(cnfe); + } catch (InstantiationException ie) { + System.err.println(ie); + } catch (IllegalAccessException iae) { + System.err.println(iae); + } catch (IOException ioe) { + System.err.println(ioe); + jarfile.delete(); + } + } + + /** + * Returns Vector containing the available plugins. + * @return List pluginVector + */ + public List<IPlugin> getAvailablePlugins() { + return pluginVector; + } +} Added: trunk/DAVInspector/src/de/dlr/davinspector/plugin/package.html =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/package.html (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/package.html 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,12 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" +"http://www.w3.org/TR/REC-html40/loose.dtd"> + +<html><head><title>BLUB B</title></head><body> + +BLUB B + +<h2>Package Specification</h2> + +BLUB B + +</body></html> \ No newline at end of file Added: trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java 2008-02-07 16:37:25 UTC (rev 40) @@ -0,0 +1,150 @@ +/* + * HeaderPlugin.java + * + * TODO: wues_ha Enter comment! + * + * Created: 22.01.2008 wues_ha <email> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.davinspector.plugins.headerplugin; + +import java.awt.SystemColor; + +import javax.swing.JComponent; +import javax.swing.JTextPane; + +import de.dlr.davinspector.plugin.IViewPlugin; + + +/** + * TODO: wues_ha: Enter comment! + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public class HeaderPlugin implements IViewPlugin { + + /** + * + */ + private Boolean active = true; + + /** + * + */ + private JTextPane jTextPane = null; + + /** + * {@inheritDoc} + * + * @see de.dlr.DAVInspector.Plugin.IViewPlugin#getUI() + */ + public JComponent getUI() { + return jTextPane; + } + + /** + * {@inheritDoc} + * + * @see de.dlr.DAVInspector.Plugin.IPlugin#getAuthor() + */ + public String getAuthor() { + return "Jochen Wuest"; + } + + /** + * {@inheritDoc} + * + * @see de.dlr.DAVInspector.Plugin.IPlugin#getDescription() + */ + public String getDescription() { + return "Display header data."; + } + + /** + * {@inheritDoc} + * + * @see de.dlr.DAVInspector.Plugin.IPlugin#getName() + */ + public String getName() { + return "Header"; + } + + /** + * {@inheritDoc} +... [truncated message content] |
From: <wu...@us...> - 2008-02-07 16:28:46
|
Revision: 39 http://davinspector.svn.sourceforge.net/davinspector/?rev=39&view=rev Author: wuest Date: 2008-02-07 08:28:44 -0800 (Thu, 07 Feb 2008) Log Message: ----------- Removed Paths: ------------- trunk/DAVInspector/src/de/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-07 16:03:52
|
Revision: 38 http://davinspector.svn.sourceforge.net/davinspector/?rev=38&view=rev Author: wuest Date: 2008-02-07 08:03:44 -0800 (Thu, 07 Feb 2008) Log Message: ----------- Moved to another directory. Removed Paths: ------------- trunk/DAVInspector/src/de/dlr/DAVInspector/icons/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-07 15:59:29
|
Revision: 37 http://davinspector.svn.sourceforge.net/davinspector/?rev=37&view=rev Author: wuest Date: 2008-02-07 07:59:03 -0800 (Thu, 07 Feb 2008) Log Message: ----------- Reorganisation of files and folders. Modified Paths: -------------- trunk/DAVInspector/DAVInspector.bat trunk/DAVInspector/build-user.xml Added Paths: ----------- trunk/DAVInspector/resource/ trunk/DAVInspector/resource/configure.png trunk/DAVInspector/resource/connect_no.png trunk/DAVInspector/resource/control_play.png trunk/DAVInspector/resource/control_stop.png trunk/DAVInspector/resource/delete.png trunk/DAVInspector/resource/deleteleft.png trunk/DAVInspector/resource/deleteright.png trunk/DAVInspector/resource/documentinfo.png trunk/DAVInspector/resource/exit.png trunk/DAVInspector/resource/help.png trunk/DAVInspector/resource/inspector16.png trunk/DAVInspector/resource/inspector32.ico trunk/DAVInspector/resource/inspector32.png trunk/DAVInspector/resource/totheleft.png trunk/DAVInspector/resource/totheright.png trunk/DAVInspector/resource/wizard.png trunk/DAVInspector/src-style/ trunk/DAVInspector/src-style/checks.xml trunk/DAVInspector/src-style/eclipse-codetemplates.xml trunk/DAVInspector/src-style/eclipse-formatter.xml Removed Paths: ------------- trunk/DAVInspector/src/src-style/ Modified: trunk/DAVInspector/DAVInspector.bat =================================================================== --- trunk/DAVInspector/DAVInspector.bat 2008-02-06 10:47:44 UTC (rev 36) +++ trunk/DAVInspector/DAVInspector.bat 2008-02-07 15:59:03 UTC (rev 37) @@ -1,3 +1,3 @@ @echo off -C:\Programme\Java\jdk1.6.0\bin\java -jar DAVInspector.jar +java -jar DAVInspector.jar Modified: trunk/DAVInspector/build-user.xml =================================================================== --- trunk/DAVInspector/build-user.xml 2008-02-06 10:47:44 UTC (rev 36) +++ trunk/DAVInspector/build-user.xml 2008-02-07 15:59:03 UTC (rev 37) @@ -18,24 +18,29 @@ <!-- Create plugin jar files --> <jar jarfile="${dist}/plugins/HeaderPlugin.jar" basedir="bin" - includes="de/dlr/DAVInspector/plugins/HeaderPlugin/**"> + includes="de/dlr/davinspector/plugins/headerplugin/**"> </jar> <jar jarfile="${dist}/plugins/XMLPlugin.jar" basedir="bin" - includes="de/dlr/DAVInspector/plugins/XMLPlugin/**"> + includes="de/dlr/davinspector/plugins/xmlplugin/**"> </jar> <jar jarfile="${dist}/plugins/XMLTreePlugin.jar" basedir="bin" - includes="de/dlr/DAVInspector/plugins/XMLTreePlugin/**"> + includes="de/dlr/davinspector/plugins/xmltreeplugin/**"> </jar> + <!-- Copy DAVInspector resource files --> + <copy todir="bin/de/dlr/davinspector/resource"> + <fileset dir="resource" includes="*.png" /> + </copy> + <!-- Create DAVInspector jar file --> <jar jarfile="${dist}/DAVInspector.jar" basedir="bin" - includes="de/dlr/DAVInspector/**" - excludes="de/dlr/DAVInspector/plugins/**, de/dlr/DAVInspector/src-style/**"> + includes="de/dlr/davinspector/**" + excludes="de/dlr/davinspector/plugins/**"> <manifest> - <attribute name="Main-Class" value="de/dlr/DAVInspector.DAVInspector"/> + <attribute name="Main-Class" value="de/dlr/davinspector.DAVInspector"/> <attribute name="Built-By" value="${user.name}"/> <section name="DAVInspector"> <attribute name="Specification-Title" value="DAVInspector"/> @@ -48,10 +53,10 @@ </manifest> </jar> - <!-- Copy script files --> + <!-- Copy script files and icon --> <copy todir="${dist}"> - <fileset dir="." includes="*.bat, config.properties" /> - <fileset dir="bin/de/dlr/DAVInspector/icons/" includes="*.ico" /> + <fileset dir="." includes="*.bat, config.properties" /> + <fileset dir="resource" includes="*.ico" /> </copy> </target> Copied: trunk/DAVInspector/resource/configure.png (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/configure.png) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/resource/connect_no.png (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/connect_no.png) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/resource/control_play.png (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/control_play.png) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/resource/control_stop.png (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/control_stop.png) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/resource/delete.png (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/delete.png) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/resource/deleteleft.png (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/deleteleft.png) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/resource/deleteright.png (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/deleteright.png) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/resource/documentinfo.png (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/documentinfo.png) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/resource/exit.png (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/exit.png) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/resource/help.png (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/help.png) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/resource/inspector16.png (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/inspector16.png) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/resource/inspector32.ico (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/inspector32.ico) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/resource/inspector32.png (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/inspector32.png) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/resource/totheleft.png (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/totheleft.png) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/resource/totheright.png (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/totheright.png) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/resource/wizard.png (from rev 35, trunk/DAVInspector/src/de/dlr/DAVInspector/icons/wizard.png) =================================================================== (Binary files differ) Copied: trunk/DAVInspector/src-style/checks.xml (from rev 35, trunk/DAVInspector/src/src-style/checks.xml) =================================================================== --- trunk/DAVInspector/src-style/checks.xml (rev 0) +++ trunk/DAVInspector/src-style/checks.xml 2008-02-07 15:59:03 UTC (rev 37) @@ -0,0 +1,151 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + This configuration file was written by the eclipse-cs plugin configuration editor +--> +<!-- + Checkstyle-Configuration: DAVInspector + Description: none +--> +<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> +<module name="Checker"> + <property name="severity" value="warning"/> + <module name="TreeWalker"> + <property name="tabWidth" value="4"/> + <module name="FileContentsHolder"/> + <module name="JavadocVariable"/> + <module name="JavadocStyle"/> + <module name="JavadocType"> + <property name="scope" value="anoninner"/> + <property name="authorFormat" value="[A-Z][\-\p{L}]*\s+[\p{L}\.\s]*[A-Z][\-\p{L}]*"/> + <property name="versionFormat" value="\$LastChangedRevision.*\$"/> + </module> + <module name="JavadocMethod"/> + <module name="ConstantName"/> + <module name="LocalFinalVariableName"/> + <module name="LocalVariableName"/> + <module name="MemberName"/> + <module name="MethodName"/> + <module name="PackageName"/> + <module name="ParameterName"/> + <module name="StaticVariableName"/> + <module name="TypeName"/> + <module name="AvoidStarImport"/> + <module name="IllegalImport"/> + <module name="RedundantImport"/> + <module name="UnusedImports"/> + <module name="ImportOrder"> + <property name="groups" value="java,java.beans,java.awt,javax,junit,org.omg,org.apache,org.globus,org,com,COM,de.rcenvironment,de"/> + <property name="separated" value="true"/> + </module> + <module name="FileLength"/> + <module name="LineLength"> + <property name="max" value="140"/> + </module> + <module name="MethodLength"> + <property name="tokens" value="METHOD_DEF"/> + </module> + <module name="ParameterNumber"> + <property name="tokens" value="METHOD_DEF"/> + </module> + <module name="EmptyForIteratorPad"/> + <module name="MethodParamPad"/> + <module name="OperatorWrap"/> + <module name="ParenPad"/> + <module name="TypecastParenPad"/> + <module name="WhitespaceAfter"/> + <module name="WhitespaceAround"> + <property name="tokens" value="ASSIGN,MINUS,PLUS,PLUS_ASSIGN,MINUS_ASSIGN,STAR_ASSIGN,DIV_ASSIGN,QUESTION,LOR,LAND,NOT_EQUAL,EQUAL,LT,GT,LE,GE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE"/> + </module> + <module name="TabCharacter"/> + <module name="ModifierOrder"/> + <module name="RedundantModifier"/> + <module name="AvoidNestedBlocks"/> + <module name="EmptyBlock"/> + <module name="LeftCurly"/> + <module name="NeedBraces"/> + <module name="RightCurly"/> + <module name="AvoidInlineConditionals"/> + <module name="DoubleCheckedLocking"/> + <module name="EmptyStatement"/> + <module name="EqualsHashCode"/> + <module name="HiddenField"/> + <module name="InnerAssignment"/> + <module name="IllegalInstantiation"> + <property name="classes" value="java.lang.Boolean"/> + </module> + <module name="MagicNumber"> + <property name="ignoreNumbers" value="0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10"/> + </module> + <module name="MissingSwitchDefault"/> + <module name="ModifiedControlVariable"/> + <module name="RedundantThrows"/> + <module name="SimplifyBooleanExpression"/> + <module name="SimplifyBooleanReturn"/> + <module name="StringLiteralEquality"/> + <module name="NestedIfDepth"> + <property name="max" value="3"/> + </module> + <module name="NestedTryDepth"> + <property name="max" value="3"/> + </module> + <module name="IllegalCatch"> + <property name="illegalClassNames" value="java.lang.Exception, java.lang.Throwable"/> + </module> + <module name="ReturnCount"> + <property name="max" value="3"/> + </module> + <module name="IllegalType"/> + <module name="DeclarationOrder"/> + <module name="DefaultComesLast"/> + <module name="MultipleStringLiterals"> + <property name="allowedDuplicates" value="2"/> + <property name="ignoreStringsRegexp" value="^(("")|(", ")|(" ")|("\\n")||("\)")|("\(")|("Dialog"))$"/> + </module> + <module name="MultipleVariableDeclarations"/> + <module name="FinalClass"/> + <module name="HideUtilityClassConstructor"/> + <module name="MutableException"/> + <module name="InterfaceIsType"/> + <module name="VisibilityModifier"> + <property name="protectedAllowed" value="true"/> + </module> + <module name="GenericIllegalRegexp"> + <property name="format" value="e\.printStackTrace"/> + <property name="message" value="Provide a useful error message (instead of e.printStackTrace())."/> + </module> + <module name="UpperEll"/> + <module name="ArrayTypeStyle"/> + <module name="Indentation"> + <property name="caseIndent" value="0"/> + </module> + <module name="GenericIllegalRegexp"> + <property name="format" value="System[.]out[.]print"/> + <property name="message" value="Usage of print and println is not allowed."/> + </module> + <module name="Regexp"> + <property name="format" value="\A/\*\n \* [A-Z][a-zA-Z0-9]*\.java\n \*\s*\n"/> + <property name="message" value="Correct file header not found (1)! Add file header from template. (Filename)"/> + </module> + <module name="Regexp"> + <property name="format" value=" \* Copyright [\d]+ Deutsches Zentrum fuer Luft- und Raumfahrt e\.V\. \(DLR\)\n"/> + <property name="message" value="Correct file header not found (2)! Add file header from template. (Copyright)"/> + </module> + <module name="Regexp"> + <property name="format" value=" \* \$Id"/> + <property name="message" value="Correct file header not found (3)! Add file header from template. (ID)"/> + </module> + <module name="Regexp"> + <property name="format" value=" \* Licensed under the Apache License, Version 2\.0 \(the 'License'\);\n"/> + <property name="message" value="Correct file header not found (4)! Add file header from template. (License)"/> + </module> + <module name="LineLength"> + <property name="max" value="140"/> + </module> + </module> + <module name="PackageHtml"/> + <module name="NewlineAtEndOfFile"/> + <module name="Translation"/> + <module name="SuppressionCommentFilter"> + <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="SuppressionCommentFilter"/> + </module> +</module> Copied: trunk/DAVInspector/src-style/eclipse-codetemplates.xml (from rev 35, trunk/DAVInspector/src/src-style/eclipse-codetemplates.xml) =================================================================== --- trunk/DAVInspector/src-style/eclipse-codetemplates.xml (rev 0) +++ trunk/DAVInspector/src-style/eclipse-codetemplates.xml 2008-02-07 15:59:03 UTC (rev 37) @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?><templates><template autoinsert="true" context="gettercomment_context" deleted="false" description="Comment for getter method" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name="gettercomment">/** + * ${todo}: ${user}: Comment! + * @return Returns the ${bare_field_name}. + */</template><template autoinsert="true" context="settercomment_context" deleted="false" description="Comment for setter method" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.settercomment" name="settercomment">/** + * ${todo}: ${user}: Comment! + * @param ${param} The ${bare_field_name} to set. + */</template><template autoinsert="true" context="constructorcomment_context" deleted="false" description="Comment for created constructors" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name="constructorcomment">/** + * ${todo}: ${user}: enter comment! + * + * ${tags} + */</template><template autoinsert="true" context="filecomment_context" deleted="false" description="Comment for created Java files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.filecomment" name="filecomment">/** + * + */</template><template autoinsert="false" context="typecomment_context" deleted="false" description="Comment for created types" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.typecomment" name="typecomment">/** + * ${todo}: ${user}: Enter comment! + * + * @version $$LastChangedRevision$$ + * @author ${user} + */</template><template autoinsert="true" context="fieldcomment_context" deleted="false" description="Comment for fields" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name="fieldcomment">/** + * + */</template><template autoinsert="true" context="methodcomment_context" deleted="false" description="Comment for non-overriding methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name="methodcomment">/** + * ${todo}: ${user}: Enter comment! + * + * ${tags} + */</template><template autoinsert="true" context="overridecomment_context" deleted="false" description="Comment for overriding methods" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name="overridecomment">/** + * {@inheritDoc} + * + * ${see_to_overridden} + */</template><template autoinsert="false" context="newtype_context" deleted="false" description="New classes and interfaces" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.newtype" name="newtype">/* + * ${file_name} + * + * ${todo}: ${user} Enter comment! + * + * Created: ${date} ${user} <email> + * Changed: + * + * $$Id$$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +${package_declaration} + +${typecomment} +${type_declaration}</template><template autoinsert="true" context="catchblock_context" deleted="false" description="Code in new catch blocks" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.catchblock" name="catchblock">// ${todo} Auto-generated catch block +logger.error(${exception_var}.getStackTrace());</template><template autoinsert="true" context="methodbody_context" deleted="false" description="Code in created method stubs" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.methodbody" name="methodbody">// ${todo} Auto-generated method stub +${body_statement}</template><template autoinsert="true" context="constructorbody_context" deleted="false" description="Code in created constructor stubs" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name="constructorbody">${body_statement} +// ${todo} Auto-generated constructor stub</template><template autoinsert="true" context="getterbody_context" deleted="false" description="Code in created getters" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.getterbody" name="getterbody">return ${field};</template><template autoinsert="true" context="setterbody_context" deleted="false" description="Code in created setters" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.setterbody" name="setterbody">${field} = ${param};</template></templates> \ No newline at end of file Copied: trunk/DAVInspector/src-style/eclipse-formatter.xml (from rev 35, trunk/DAVInspector/src/src-style/eclipse-formatter.xml) =================================================================== --- trunk/DAVInspector/src-style/eclipse-formatter.xml (rev 0) +++ trunk/DAVInspector/src-style/eclipse-formatter.xml 2008-02-07 15:59:03 UTC (rev 37) @@ -0,0 +1,246 @@ +<?xml version="1.0" encoding="UTF-8"?> +<profiles version="8"> +<profile name="DAVInspector Conventions" version="8"> +<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="82"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/> +<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_comments" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="140"/> +<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/> +<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/> +<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="140"/> +<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/> +<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/> +<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/> +<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/> +</profile> +</profiles> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-06 10:47:49
|
Revision: 36 http://davinspector.svn.sourceforge.net/davinspector/?rev=36&view=rev Author: wuest Date: 2008-02-06 02:47:44 -0800 (Wed, 06 Feb 2008) Log Message: ----------- Moved Constant to package Common. Changed About dialog. Activated rendering of checkboxes in PluginConfigurationDialog. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/DAVInspector/Configuration/Configuration.java trunk/DAVInspector/src/de/dlr/DAVInspector/History/HistoryTableCellRenderer.java trunk/DAVInspector/src/de/dlr/DAVInspector/Plugin/Plugin.java trunk/DAVInspector/src/de/dlr/DAVInspector/Relay/ChannelThread.java trunk/DAVInspector/src/de/dlr/DAVInspector/Relay/RelayModel.java trunk/DAVInspector/src/de/dlr/DAVInspector/UI/AboutDialog.java trunk/DAVInspector/src/de/dlr/DAVInspector/UI/ConfigurationDialog.java trunk/DAVInspector/src/de/dlr/DAVInspector/UI/MainView.java trunk/DAVInspector/src/de/dlr/DAVInspector/UI/PluginConfigurationDialog.java trunk/DAVInspector/src/de/dlr/DAVInspector/plugins/HeaderPlugin/HeaderPlugin.java trunk/DAVInspector/src/de/dlr/DAVInspector/plugins/XMLPlugin/XMLPlugin.java trunk/DAVInspector/src/de/dlr/DAVInspector/plugins/XMLTreePlugin/XMLTreePlugin.java Added Paths: ----------- trunk/DAVInspector/src/de/dlr/DAVInspector/Common/Constant.java Removed Paths: ------------- trunk/DAVInspector/src/de/dlr/DAVInspector/Configuration/Constant.java Copied: trunk/DAVInspector/src/de/dlr/DAVInspector/Common/Constant.java (from rev 34, trunk/DAVInspector/src/de/dlr/DAVInspector/Configuration/Constant.java) =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/Common/Constant.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/Common/Constant.java 2008-02-06 10:47:44 UTC (rev 36) @@ -0,0 +1,202 @@ +/* + * Constants.java + * + * Definition aller ben\xF6tigten Konstanten. + * + * Created: 11.10.2007 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package de.dlr.DAVInspector.Common; + +import java.awt.Color; + + +/** + * Constants. + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public final class Constant { + + /** + * GUI Width. + */ + public static final int UI_MAIN_WINDOW_WIDTH = 800; + + /** + * GUI Height. + */ + public static final int UI_MAIN_WINDOW_HEIGHT = 600; + + /** + * Configuration Dialog Width. + */ + public static final int UI_CONFIG_DIALOG_WIDTH = 300; + + /** + * Configuration Dialog Height. + */ + public static final int UI_CONFIG_DIALOG_HEIGHT = 200; + + /** + * + */ + public static final int UI_PLUGIN_CONFIG_DIALOG_WIDTH = 650; + + /** + * + */ + public static final int UI_PLUGIN_CONFIG_DIALOG_HEIGTH = 250; + + /** + * + */ + public static final int UI_ABOUT_DIALOG_WIDTH = 250; + + /** + * + */ + public static final int UI_ABOUT_DIALOG_HEIGTH = 175; + + /** + * + */ + public static final Color UI_REPLY_COLOR = new Color(255, 204, 102); + + /** + * + */ + public static final Color UI_REQUEST_COLOR = new Color(170, 240, 240); + + /** + * Line Feed + Carriage Return. + */ + public static final String LFCR = "\r\n"; + + /** + * Line Feed. + */ + public static final String LF = "\r"; + + /** + * Carriage Return. + */ + public static final String CR = "\n"; + + /** + * EOF. + */ + public static final int EOF = -1; + + /** + * Application Title. + */ + public static final String APP_TITLE = "DAVInspector"; + + /** + * Filename of the configuration file. + */ + public static final String APP_VERSION = "0.1"; + + /** + * Filename of the configuration file. + */ + public static final String CONFIGURATION_FILENAME = "config.properties"; + + /** + * Timeout waiting for a StreamCopyThread to finish in ms. + */ + public static final int PROXY_THREADTIMEOUT = 100; + + /** + * Linger time in seconds for socket. + */ + public static final int PROXY_LINGERTIME = 5; + + /** + * Size of the receive buffer. + */ + public static final int PROXY_RECVBUFFERSIZE = 1024; + + /** + * Backlog parameter used when creating the ServerSocket. + */ + public static final int PROXY_BACKLOG = 100; + + /** + * Address of the Server. IP address or domain name. + */ + public static final String PROXY_SERVERADDRESS = "localhost"; //"bsasdf01.as.bs.dlr.de"; + + /** + * Server port. + */ + public static final int PROXY_SERVERPORT = 8080; + + /** + * Address of the Client. Normally this is empty and + * the address of the client is of no importance. + */ + public static final String PROXY_CLIENTADDRESS = ""; + + /** + * Client port. + */ + public static final int PROXY_CLIENTPORT = 8888; + + /** + * Indentifier for plugin-type. + * ### plugin for server & client!? + */ + public enum PlugInType { + /** + * + */ + ViewGeneral, + /** + * + */ + EditGeneral, + /** + * + */ + ViewClient, + /** + * + */ + ViewServer, + /** + * + */ + EditClient, + /** + * + */ + EditServer + } + + /** + * TODO: wues_ha: enter comment! + * + */ + private Constant() { + + } +} Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/Configuration/Configuration.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/Configuration/Configuration.java 2008-02-06 10:38:29 UTC (rev 35) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/Configuration/Configuration.java 2008-02-06 10:47:44 UTC (rev 36) @@ -32,6 +32,7 @@ import java.util.Properties; import java.util.Vector; +import de.dlr.DAVInspector.Common.Constant; import de.dlr.DAVInspector.Plugin.Plugin; Deleted: trunk/DAVInspector/src/de/dlr/DAVInspector/Configuration/Constant.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/Configuration/Constant.java 2008-02-06 10:38:29 UTC (rev 35) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/Configuration/Constant.java 2008-02-06 10:47:44 UTC (rev 36) @@ -1,202 +0,0 @@ -/* - * Constants.java - * - * Definition aller ben\xF6tigten Konstanten. - * - * Created: 11.10.2007 Jochen Wuest <joc...@dl...> - * Changed: - * - * $Id$ - * - * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) - * - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package de.dlr.DAVInspector.Configuration; - -import java.awt.Color; - - -/** - * Constants. - * @version $LastChangedRevision$ - * @author Jochen Wuest - */ -public final class Constant { - - /** - * GUI Width. - */ - public static final int UI_MAIN_WINDOW_WIDTH = 800; - - /** - * GUI Height. - */ - public static final int UI_MAIN_WINDOW_HEIGHT = 600; - - /** - * Configuration Dialog Width. - */ - public static final int UI_CONFIG_DIALOG_WIDTH = 300; - - /** - * Configuration Dialog Height. - */ - public static final int UI_CONFIG_DIALOG_HEIGHT = 200; - - /** - * - */ - public static final int UI_PLUGIN_CONFIG_DIALOG_WIDTH = 650; - - /** - * - */ - public static final int UI_PLUGIN_CONFIG_DIALOG_HEIGTH = 250; - - /** - * - */ - public static final int UI_ABOUT_DIALOG_WIDTH = 300; - - /** - * - */ - public static final int UI_ABOUT_DIALOG_HEIGTH = 300; - - /** - * - */ - public static final Color UI_REPLY_COLOR = new Color(255, 204, 102); - - /** - * - */ - public static final Color UI_REQUEST_COLOR = new Color(170, 240, 240); - - /** - * Line Feed + Carriage Return. - */ - public static final String LFCR = "\r\n"; - - /** - * Line Feed. - */ - public static final String LF = "\r"; - - /** - * Carriage Return. - */ - public static final String CR = "\n"; - - /** - * EOF. - */ - public static final int EOF = -1; - - /** - * Application Title. - */ - public static final String APP_TITLE = "DAVInspector"; - - /** - * Filename of the configuration file. - */ - public static final String APP_VERSION = "0.1"; - - /** - * Filename of the configuration file. - */ - public static final String CONFIGURATION_FILENAME = "config.properties"; - - /** - * Timeout waiting for a StreamCopyThread to finish in ms. - */ - public static final int PROXY_THREADTIMEOUT = 100; - - /** - * Linger time in seconds for socket. - */ - public static final int PROXY_LINGERTIME = 5; - - /** - * Size of the receive buffer. - */ - public static final int PROXY_RECVBUFFERSIZE = 1024; - - /** - * Backlog parameter used when creating the ServerSocket. - */ - public static final int PROXY_BACKLOG = 100; - - /** - * Address of the Server. IP address or domain name. - */ - public static final String PROXY_SERVERADDRESS = "localhost"; //"bsasdf01.as.bs.dlr.de"; - - /** - * Server port. - */ - public static final int PROXY_SERVERPORT = 8080; - - /** - * Address of the Client. Normally this is empty and - * the address of the client is of no importance. - */ - public static final String PROXY_CLIENTADDRESS = ""; - - /** - * Client port. - */ - public static final int PROXY_CLIENTPORT = 8888; - - /** - * Indentifier for plugin-type. - * ### plugin for server & client!? - */ - public enum PlugInType { - /** - * - */ - ViewGeneral, - /** - * - */ - EditGeneral, - /** - * - */ - ViewClient, - /** - * - */ - ViewServer, - /** - * - */ - EditClient, - /** - * - */ - EditServer - } - - /** - * TODO: HJW: enter comment! - * - */ - private Constant() { - - } -} Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/History/HistoryTableCellRenderer.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/History/HistoryTableCellRenderer.java 2008-02-06 10:38:29 UTC (rev 35) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/History/HistoryTableCellRenderer.java 2008-02-06 10:47:44 UTC (rev 36) @@ -32,7 +32,7 @@ import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableCellRenderer; -import de.dlr.DAVInspector.Configuration.Constant; +import de.dlr.DAVInspector.Common.Constant; /** Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/Plugin/Plugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/Plugin/Plugin.java 2008-02-06 10:38:29 UTC (rev 35) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/Plugin/Plugin.java 2008-02-06 10:47:44 UTC (rev 36) @@ -25,7 +25,7 @@ package de.dlr.DAVInspector.Plugin; -import de.dlr.DAVInspector.Configuration.Constant.PlugInType; +import de.dlr.DAVInspector.Common.Constant.PlugInType; /** * TODO: wues_ha: Enter comment! Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/Relay/ChannelThread.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/Relay/ChannelThread.java 2008-02-06 10:38:29 UTC (rev 35) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/Relay/ChannelThread.java 2008-02-06 10:47:44 UTC (rev 36) @@ -32,7 +32,7 @@ import java.net.Socket; import java.net.SocketException; -import de.dlr.DAVInspector.Configuration.Constant; +import de.dlr.DAVInspector.Common.Constant; /** * TODO: wues_ha: Enter comment! Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/Relay/RelayModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/Relay/RelayModel.java 2008-02-06 10:38:29 UTC (rev 35) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/Relay/RelayModel.java 2008-02-06 10:47:44 UTC (rev 36) @@ -36,8 +36,8 @@ import java.util.ArrayList; import java.util.List; +import de.dlr.DAVInspector.Common.Constant; import de.dlr.DAVInspector.Configuration.Configuration; -import de.dlr.DAVInspector.Configuration.Constant; import de.dlr.DAVInspector.UI.MainView; /** Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/UI/AboutDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/UI/AboutDialog.java 2008-02-06 10:38:29 UTC (rev 35) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/UI/AboutDialog.java 2008-02-06 10:47:44 UTC (rev 36) @@ -30,14 +30,15 @@ import java.awt.SystemColor; import java.awt.Window; +import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextPane; +import de.dlr.DAVInspector.Common.Constant; import de.dlr.DAVInspector.Common.Util; -import de.dlr.DAVInspector.Configuration.Constant; /** * TODO: wues_ha: Enter comment! @@ -73,8 +74,13 @@ private JPanel jPanel = null; /** - * + * */ + private JLabel jLabel1 = null; + + /** + * + */ private JLabel jLabel = null; /** @@ -102,8 +108,6 @@ */ private JPanel getJContentPane() { if (jContentPane == null) { - jLabel = new JLabel(); - jLabel.setText(Constant.APP_TITLE); jContentPane = new JPanel(); jContentPane.setLayout(new BorderLayout()); jContentPane.add(getJButton(), BorderLayout.SOUTH); @@ -149,7 +153,9 @@ if (jTextPane == null) { jTextPane = new JTextPane(); jTextPane.setBackground(SystemColor.control); - jTextPane.setText("Apache 2.0 Lizenz\nJochen Wuest\nDLR\n2007-2008"); + jTextPane.setEditable(false); + jTextPane.setText("\nVersion " + Constant.APP_VERSION + + "\n\nApache 2.0 Lizenz\n(c) Copyright Jochen Wuest, DLR 2007-2008\n"); } return jTextPane; } @@ -166,9 +172,14 @@ //logo.setHorizontalAlignment(AbstractButton.CENTER); //jPanel.add(logo, BorderLayout.NORTH); + jLabel = new JLabel(); + jLabel.setText(" " + Constant.APP_TITLE); + jLabel1 = new JLabel(); + jLabel1.setIcon(new ImageIcon(getClass().getResource("/de/dlr/DAVInspector/icons/inspector32.png"))); jPanel = new JPanel(); jPanel.setLayout(new BorderLayout()); - jPanel.add(jLabel, BorderLayout.SOUTH); + jPanel.add(jLabel1, BorderLayout.WEST); + jPanel.add(jLabel, BorderLayout.CENTER); } return jPanel; } Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/UI/ConfigurationDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/UI/ConfigurationDialog.java 2008-02-06 10:38:29 UTC (rev 35) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/UI/ConfigurationDialog.java 2008-02-06 10:47:44 UTC (rev 36) @@ -37,9 +37,9 @@ import javax.swing.JTextField; import javax.swing.SwingConstants; +import de.dlr.DAVInspector.Common.Constant; import de.dlr.DAVInspector.Common.Util; import de.dlr.DAVInspector.Configuration.Configuration; -import de.dlr.DAVInspector.Configuration.Constant; /** * TODO: wues_ha: Enter comment! Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/UI/MainView.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/UI/MainView.java 2008-02-06 10:38:29 UTC (rev 35) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/UI/MainView.java 2008-02-06 10:47:44 UTC (rev 36) @@ -51,9 +51,9 @@ import javax.swing.JTextPane; import javax.swing.JToggleButton; +import de.dlr.DAVInspector.Common.Constant; +import de.dlr.DAVInspector.Common.Constant.PlugInType; import de.dlr.DAVInspector.Common.Util; -import de.dlr.DAVInspector.Configuration.Constant; -import de.dlr.DAVInspector.Configuration.Constant.PlugInType; import de.dlr.DAVInspector.History.HistoryTableCellRenderer; import de.dlr.DAVInspector.History.HistoryTableModel; import de.dlr.DAVInspector.Plugin.Plugin; Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/UI/PluginConfigurationDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/UI/PluginConfigurationDialog.java 2008-02-06 10:38:29 UTC (rev 35) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/UI/PluginConfigurationDialog.java 2008-02-06 10:47:44 UTC (rev 36) @@ -36,8 +36,8 @@ import javax.swing.JScrollPane; import javax.swing.JTable; +import de.dlr.DAVInspector.Common.Constant; import de.dlr.DAVInspector.Common.Util; -import de.dlr.DAVInspector.Configuration.Constant; import de.dlr.DAVInspector.Plugin.Plugin; /** Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/plugins/HeaderPlugin/HeaderPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/plugins/HeaderPlugin/HeaderPlugin.java 2008-02-06 10:38:29 UTC (rev 35) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/plugins/HeaderPlugin/HeaderPlugin.java 2008-02-06 10:47:44 UTC (rev 36) @@ -30,7 +30,7 @@ import javax.swing.JComponent; import javax.swing.JTextPane; -import de.dlr.DAVInspector.Configuration.Constant.PlugInType; +import de.dlr.DAVInspector.Common.Constant.PlugInType; import de.dlr.DAVInspector.Plugin.ViewPlugin; Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/plugins/XMLPlugin/XMLPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/plugins/XMLPlugin/XMLPlugin.java 2008-02-06 10:38:29 UTC (rev 35) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/plugins/XMLPlugin/XMLPlugin.java 2008-02-06 10:47:44 UTC (rev 36) @@ -29,7 +29,7 @@ import javax.swing.JComponent; -import de.dlr.DAVInspector.Configuration.Constant.PlugInType; +import de.dlr.DAVInspector.Common.Constant.PlugInType; import de.dlr.DAVInspector.Plugin.ViewPlugin; Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/plugins/XMLTreePlugin/XMLTreePlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/plugins/XMLTreePlugin/XMLTreePlugin.java 2008-02-06 10:38:29 UTC (rev 35) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/plugins/XMLTreePlugin/XMLTreePlugin.java 2008-02-06 10:47:44 UTC (rev 36) @@ -31,7 +31,7 @@ import org.xml.sax.SAXException; -import de.dlr.DAVInspector.Configuration.Constant.PlugInType; +import de.dlr.DAVInspector.Common.Constant.PlugInType; import de.dlr.DAVInspector.Plugin.ViewPlugin; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-06 10:38:37
|
Revision: 35 http://davinspector.svn.sourceforge.net/davinspector/?rev=35&view=rev Author: wuest Date: 2008-02-06 02:38:29 -0800 (Wed, 06 Feb 2008) Log Message: ----------- Some minor changes Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/DAVInspector/Common/Util.java trunk/DAVInspector/src/de/dlr/DAVInspector/Configuration/Constant.java trunk/DAVInspector/src/de/dlr/DAVInspector/HTTP/HTTPStatusCode.java trunk/DAVInspector/src/de/dlr/DAVInspector/Relay/ChannelThread.java trunk/DAVInspector/src/de/dlr/DAVInspector/UI/PluginConfigurationTableModel.java Added Paths: ----------- trunk/DAVInspector/src/de/dlr/DAVInspector/Common/package.html Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/Common/Util.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/Common/Util.java 2008-02-06 10:15:00 UTC (rev 34) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/Common/Util.java 2008-02-06 10:38:29 UTC (rev 35) @@ -37,10 +37,22 @@ * TODO: HJW: Enter comment! * * @version $LastChangedRevision$ - * @author HJW + * @author Jochen Wuest */ -public class Util { +public final class Util { + /** + * TODO: HJW: enter comment! + * + */ + private Util() { + + } + + /** + * TODO: HJW: Enter comment! + * + */ public static void setUIDesign() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); @@ -55,6 +67,11 @@ } } + /** + * TODO: HJW: Enter comment! + * + * @param window Window + */ public static void centerWindow(Window window) { // Center the window Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Added: trunk/DAVInspector/src/de/dlr/DAVInspector/Common/package.html =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/Common/package.html (rev 0) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/Common/package.html 2008-02-06 10:38:29 UTC (rev 35) @@ -0,0 +1,12 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" +"http://www.w3.org/TR/REC-html40/loose.dtd"> + +<html><head><title>BLUB B</title></head><body> + +BLUB B + +<h2>Package Specification</h2> + +BLUB B + +</body></html> \ No newline at end of file Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/Configuration/Constant.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/Configuration/Constant.java 2008-02-06 10:15:00 UTC (rev 34) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/Configuration/Constant.java 2008-02-06 10:38:29 UTC (rev 35) @@ -191,4 +191,12 @@ */ EditServer } + + /** + * TODO: HJW: enter comment! + * + */ + private Constant() { + + } } Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/HTTP/HTTPStatusCode.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/HTTP/HTTPStatusCode.java 2008-02-06 10:15:00 UTC (rev 34) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/HTTP/HTTPStatusCode.java 2008-02-06 10:38:29 UTC (rev 35) @@ -1,23 +1,23 @@ /* * HTTPStatusCode.java - * + * * TODO: wues_ha Enter comment! - * + * * Created: 23.01.2008 Jochen Wuest <joc...@dl...> * Changed: - * + * * $Id$ - * + * * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) - * + * * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. @@ -26,13 +26,13 @@ package de.dlr.DAVInspector.HTTP; /** - * HTTP status codes according to + * HTTP status codes according to * RFC2616 (HTTP1.1) and RFC 4918 (WebDAV). - * + * * @version $LastChangedRevision$ * @author Jochen Wuest */ -public class HTTPStatusCode { +public final class HTTPStatusCode { // CHECKSTYLE:OFF /* * 1xx: Informational - Request received, continuing process @@ -85,8 +85,8 @@ public static final int HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416; public static final int HTTP_EXPECTATION_FAILED = 417; public static final int HTTP_UNPROCESSABLE_ENTITY = 422; - public static final int HTTP_LOCKED = 423; - public static final int HTTP_FAILED_DEPENDENCY = 424; + public static final int HTTP_LOCKED = 423; + public static final int HTTP_FAILED_DEPENDENCY = 424; /* * 5xx: Server Error - The server failed to fulfill an apparently valid request @@ -97,6 +97,14 @@ public static final int HTTP_SERVICE_UNAVAILABLE = 503; public static final int HTTP_GATEWAY_TIEMOUT = 504; public static final int HTTP_HTTP_VERSION_NOT_SUPPORTED = 505; - public static final int HTTP_INSUFFICIENT_STORAGE = 507; + public static final int HTTP_INSUFFICIENT_STORAGE = 507; // CHECKSTYLE:ON + + /** + * TODO: HJW: enter comment! + * + */ + private HTTPStatusCode() { + + } } Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/Relay/ChannelThread.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/Relay/ChannelThread.java 2008-02-06 10:15:00 UTC (rev 34) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/Relay/ChannelThread.java 2008-02-06 10:38:29 UTC (rev 35) @@ -108,6 +108,7 @@ * * @see java.lang.Thread#run() */ + @Override public void run() { byte[] buffer = new byte[Constant.PROXY_RECVBUFFERSIZE]; int count = Constant.EOF; @@ -119,13 +120,13 @@ while ((count != Constant.EOF) && !isInterrupted()) { synchronized (lock) { lock.updateData(new String(buffer, 0, count, "utf-8"), toClient); - //lock.notifyListeners(toClient); + lock.notifyListeners(toClient); } count = in.read(buffer); } - synchronized (lock) { - lock.notifyListeners(toClient); - } +// synchronized (lock) { +// lock.notifyListeners(toClient); +// } } catch (IOException ioe) { err.println(ioe); } finally { Modified: trunk/DAVInspector/src/de/dlr/DAVInspector/UI/PluginConfigurationTableModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/DAVInspector/UI/PluginConfigurationTableModel.java 2008-02-06 10:15:00 UTC (rev 34) +++ trunk/DAVInspector/src/de/dlr/DAVInspector/UI/PluginConfigurationTableModel.java 2008-02-06 10:38:29 UTC (rev 35) @@ -1,28 +1,28 @@ /* * PluginConfigurationTableModel.java - * + * * TODO: wues_ha Enter comment! - * + * * Created: 16.01.2008 Jochen Wuest <joc...@dl...> * Changed: - * + * * $Id$ - * + * * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) - * + * * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - + package de.dlr.DAVInspector.UI; import javax.swing.table.DefaultTableModel; @@ -37,12 +37,12 @@ public class PluginConfigurationTableModel extends DefaultTableModel { /** - * + * */ private static final long serialVersionUID = 1L; - + /** - * + * */ private String[] columnNames = { "Client", @@ -52,7 +52,7 @@ "Author", "Description" }; - + /** * {@inheritDoc} * @@ -70,19 +70,17 @@ */ public String getColumnName(int col) { return columnNames[col]; - } + } /** * {@inheritDoc} * * @see javax.swing.table.AbstractTableModel#getColumnClass(int) */ - /* public Class<?> getColumnClass(int c) { return getValueAt(0, c).getClass(); } - */ - + /** * {@inheritDoc} * @@ -93,7 +91,7 @@ return true; } return false; - } + } /** * {@inheritDoc} @@ -102,9 +100,9 @@ */ /* public void setValueAt(Object value, int row, int col) { - Vector rowVector = (Vector) dataVector.elementAt(row); + Vector rowVector = (Vector) dataVector.elementAt(row); rowVector.setElementAt(value, col); fireTableCellUpdated(row, col); - } + } */ } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |