Author: mjakl
Date: Thu Aug 13 20:02:40 2009
New Revision: 804012
URL: http://svn.apache.org/viewvc?rev=804012&view=rev
Log:
Added missing source files and adapted the pom.xml to compile with Java 5
compatibility.
Added:
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubNode.java
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubTableModel.java
Modified:
mina/sandbox/vysper/trunk/demo/pubsub/client/pom.xml
Modified: mina/sandbox/vysper/trunk/demo/pubsub/client/pom.xml
URL:
http://svn.apache.org/viewvc/mina/sandbox/vysper/trunk/demo/pubsub/client/pom.xml?rev=804012&r1=804011&r2=804012&view=diff
==============================================================================
--- mina/sandbox/vysper/trunk/demo/pubsub/client/pom.xml (original)
+++ mina/sandbox/vysper/trunk/demo/pubsub/client/pom.xml Thu Aug 13 20:02:40
2009
@@ -49,4 +49,23 @@
<version>3.1.0</version>
</dependency>
</dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>${maven.compile.source}</source>
+ <target>${maven.compile.target}</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <properties>
+ <maven.compile.source>1.5</maven.compile.source>
+ <maven.compile.target>1.5</maven.compile.target>
+ </properties>
</project>
Added:
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubNode.java
URL:
http://svn.apache.org/viewvc/mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubNode.java?rev=804012&view=auto
==============================================================================
---
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubNode.java
(added)
+++
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubNode.java
Thu Aug 13 20:02:40 2009
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.vysper.demo.pubsub.client;
+
+/**
+ * POJ for storing node information.
+ *
+ * @author The Apache MINA Project (http://mina.apache.org)
+ */
+public class PubsubNode {
+ private String node;
+ private Boolean subscribed;
+ private Boolean ownership;
+
+ public PubsubNode(String node) {
+ this.node = node;
+ }
+
+ public String getNode() {
+ return node;
+ }
+ public Boolean getSubscribed() {
+ return subscribed;
+ }
+ public void setSubscribed(Boolean subscribed) {
+ this.subscribed = subscribed;
+ }
+ public Boolean getOwnership() {
+ return ownership;
+ }
+ public void setOwnership(Boolean owner) {
+ this.ownership = owner;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return ((PubsubNode)obj).getNode().equals(getNode());
+ }
+
+ @Override
+ public int hashCode() {
+ return getNode().hashCode();
+ }
+}
Added:
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubTableModel.java
URL:
http://svn.apache.org/viewvc/mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubTableModel.java?rev=804012&view=auto
==============================================================================
---
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubTableModel.java
(added)
+++
mina/sandbox/vysper/trunk/demo/pubsub/client/src/main/java/org/apache/vysper/demo/pubsub/client/PubsubTableModel.java
Thu Aug 13 20:02:40 2009
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.vysper.demo.pubsub.client;
+
+import java.util.Vector;
+
+import javax.swing.table.AbstractTableModel;
+
+/**
+ *
+ * @author The Apache MINA Project (http://mina.apache.org)
+ */
+public class PubsubTableModel extends AbstractTableModel {
+
+ private static final long serialVersionUID = -3788690749950634883L;
+
+ private final String[] columnNames = new String[] {"Node", "Subscribed",
"Owner"};
+ private Vector<PubsubNode> nodes = new Vector<PubsubNode>();
+
+ @Override
+ public String getColumnName(int col) {
+ return columnNames[col];
+ }
+
+ @Override
+ public int getColumnCount() {
+ return columnNames.length;
+ }
+
+ @Override
+ public int getRowCount() {
+ return nodes.size();
+ }
+
+ @Override
+ public Object getValueAt(int rowIndex, int columnIndex) {
+ PubsubNode n = nodes.get(rowIndex);
+
+ if(n == null) return null;
+
+ if(columnIndex == 0) return n.getNode();
+ if(columnIndex == 1) return n.getSubscribed();
+ if(columnIndex == 2) return n.getOwnership();
+
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Class getColumnClass(int c) {
+ if(c == 0) return String.class;
+ return Boolean.class;
+ }
+
+ @Override
+ public boolean isCellEditable(int row, int col) {
+ if (col == 1) {
+ return true;
+ }
+ return false;
+ }
+
+ public void addRow(PubsubNode node) {
+ this.nodes.add(node);
+ }
+
+ public void deleteRow(int rowIndex) {
+ this.nodes.remove(rowIndex);
+ }
+
+ @Override
+ public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
+ PubsubNode n = this.nodes.get(rowIndex);
+ if(columnIndex == 1) n.setSubscribed((Boolean)aValue);
+ super.fireTableCellUpdated(rowIndex, columnIndex);
+ }
+}