You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by vf...@apache.org on 2015/10/10 03:25:22 UTC

incubator-geode git commit: GEODE-339: Fixes current JVSD build issues

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-78 e299ea844 -> ee567c311


GEODE-339: Fixes current JVSD build issues

Permits building and running the JVSD by providing build instructions
and fixing the current pom.xml with the updated instructions. This
change doesn't address GEODE-342.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/ee567c31
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/ee567c31
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/ee567c31

Branch: refs/heads/feature/GEODE-78
Commit: ee567c311b216e71d4ad043fab1ea07d1f9192c1
Parents: e299ea8
Author: Vince Ford <vf...@apache.org>
Authored: Fri Oct 9 18:24:01 2015 -0700
Committer: Vince Ford <vf...@apache.org>
Committed: Fri Oct 9 18:24:01 2015 -0700

----------------------------------------------------------------------
 jvsdfx-mm/README.txt                            | 44 +++++++++++
 jvsdfx-mm/REMOVED_JARS.txt                      | 11 ---
 jvsdfx-mm/pom.xml                               |  8 ++
 jvsdfx-mm/runjvsd.sh                            |  9 +++
 .../com/pivotal/chart/AdvancedLineChart.java    |  2 +-
 .../com/sun/javafx/charts/LegendItem.java       | 47 ------------
 .../javafx/scene/chart/AbstractSeries.java      |  2 +-
 .../com/pivotal/javafx/scene/chart/Series.java  | 81 --------------------
 .../pivotal/jvsd/controller/RootController.java | 43 +++++++++--
 .../src/main/java/com/pivotal/jvsd/fx/Main.java |  3 +-
 .../com/pivotal/jvsd/fx/StatFileManager.java    |  4 +
 jvsdfx-mm/src/main/resources/jvsd.fxml          |  5 +-
 12 files changed, 109 insertions(+), 150 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee567c31/jvsdfx-mm/README.txt
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/README.txt b/jvsdfx-mm/README.txt
new file mode 100644
index 0000000..81b9c25
--- /dev/null
+++ b/jvsdfx-mm/README.txt
@@ -0,0 +1,44 @@
+Check Java JDK version, it should version 1.8.0_60 or later.
+
+$java --version
+java version "1.8.0_60"
+Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
+Java HotSpot(TM) Server VM (build 25.60-b23, mixed mode)
+
+$jps
+13760 Jps
+ 
+Clone Geode from the Apache repository, checkout JVSD branch and then build Geode. 
+ 
+$git clone https://git-wip-us.apache.org/repos/asf/incubator-geode.git
+$cd incubator-geode/
+$git branch jvsd origin/feature/GEODE-78
+$git checkout jvsd
+$./gradlew clean build installDist -Dskip.tests=true
+
+Clone and build the third party charting library MultiAxisChartFX.
+$cd ..
+$git clone https://github.com/gemfire/MultiAxisChartFX
+$cd MultiAxisChartFX/
+$mvn install
+
+Install the MultiAxisChart jar into local maven repository.
+
+$mvn install:install-file 
+-Dfile=./MultiAxisChart-1.0-SNAPSHOT.jar 
+-DgroupId=com.pivotal.javafx 
+-DartifactId=MultiAxisChart 
+-Dversion=1.0-SNAPSHOT 
+-Dpackaging=jar 
+-DgeneratePom=true
+
+Change back into the Geode directory and then into the JVSD directory. Build JVSD.
+$cd ../incubator-geode
+$cd jvsdfx-mm/
+$mvn install
+
+Run the JVSD application.
+$runjvsd.sh
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee567c31/jvsdfx-mm/REMOVED_JARS.txt
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/REMOVED_JARS.txt b/jvsdfx-mm/REMOVED_JARS.txt
deleted file mode 100644
index aa44411..0000000
--- a/jvsdfx-mm/REMOVED_JARS.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-The following jars were removed from this source code. These should be
-downloaded from maven central as part of the build.
-
-lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
-lib/commons-cli-1.2.jar
-lib/commons-collections-3.2.1.jar
-lib/commons-io-2.0.1.jar
-lib/commons-lang3-3.0.jar
-lib/commons-net-3.0.1.jar
-lib/jcommon-1.0.21.jar
-lib/jfreechart-1.0.17.jar

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee567c31/jvsdfx-mm/pom.xml
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/pom.xml b/jvsdfx-mm/pom.xml
index 7268f96..023ea8b 100644
--- a/jvsdfx-mm/pom.xml
+++ b/jvsdfx-mm/pom.xml
@@ -33,6 +33,14 @@
 			<systemPath>${java.home}/lib/jfxrt.jar</systemPath>
 		</dependency>
 		-->
+		<dependency>
+    			<groupId>com.pivotal.javafx</groupId>
+    			<artifactId>MultiAxisChart</artifactId>
+    			<version>1.0-SNAPSHOT</version>
+			<!-- use scope and system path only if not installing jar into local maven repo -->
+    			<!--<scope>system</scope>
+    			<systemPath>${HOME}/Projects/MultiAxisChartFX/target/MultiAxisChart-1.0-SNAPSHOT.jar</systemPath> -->
+		</dependency>
 	</dependencies>
 
 	<build>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee567c31/jvsdfx-mm/runjvsd.sh
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/runjvsd.sh b/jvsdfx-mm/runjvsd.sh
new file mode 100755
index 0000000..5a3ee35
--- /dev/null
+++ b/jvsdfx-mm/runjvsd.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+echo `which java`
+
+if [ -f target/jvsd-jar-with-dependencies.jar ]; then
+    java -verbose:class -jar target/jvsd-jar-with-dependencies.jar $@ >output.txt
+else
+    echo "missing critical jar file, rebuild"
+fi
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee567c31/jvsdfx-mm/src/main/java/com/pivotal/chart/AdvancedLineChart.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/chart/AdvancedLineChart.java b/jvsdfx-mm/src/main/java/com/pivotal/chart/AdvancedLineChart.java
index dda38a9..1300af1 100644
--- a/jvsdfx-mm/src/main/java/com/pivotal/chart/AdvancedLineChart.java
+++ b/jvsdfx-mm/src/main/java/com/pivotal/chart/AdvancedLineChart.java
@@ -32,7 +32,7 @@ import javafx.scene.shape.Rectangle;
 import javafx.scene.shape.StrokeType;
 import javafx.util.Duration;
 
-import com.pivotal.com.sun.javafx.charts.LegendItem;
+import com.pivotal.javafx.scene.chart.LegendItem;
 import com.pivotal.javafx.scene.chart.Series;
 import com.pivotal.javafx.scene.chart.MultiAxisLineChart;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee567c31/jvsdfx-mm/src/main/java/com/pivotal/com/sun/javafx/charts/LegendItem.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/com/sun/javafx/charts/LegendItem.java b/jvsdfx-mm/src/main/java/com/pivotal/com/sun/javafx/charts/LegendItem.java
deleted file mode 100644
index 33961d6..0000000
--- a/jvsdfx-mm/src/main/java/com/pivotal/com/sun/javafx/charts/LegendItem.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.pivotal.com.sun.javafx.charts;
-
-import java.lang.reflect.Field;
-
-import javafx.scene.Node;
-import javafx.scene.control.Label;
-
-import com.sun.javafx.charts.Legend;
-
-/**
- * Extends {@link Legend.LegendItem} to expose label field as property.
- * 
- * @author jbarrett
- *
- */
-public class LegendItem extends Legend.LegendItem {
-
-  static final Field labelField;
-  static {
-    Field field = null;
-    try {
-      field = Legend.LegendItem.class.getDeclaredField("label");
-      field.setAccessible(true);
-    } catch (Exception e) {
-      throw new IllegalStateException(e);
-    }
-    labelField = field;
-  }
-
-  public LegendItem(String text) {
-    super(text);
-
-  }
-
-  public LegendItem(String text, Node symbol) {
-    super(text, symbol);
-  }
-  
-  public Label getLabel() {
-    try {
-      return (Label) labelField.get(this);
-    } catch (IllegalArgumentException | IllegalAccessException e) {
-      throw new IllegalStateException(e);
-    }
-  }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee567c31/jvsdfx-mm/src/main/java/com/pivotal/javafx/scene/chart/AbstractSeries.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/javafx/scene/chart/AbstractSeries.java b/jvsdfx-mm/src/main/java/com/pivotal/javafx/scene/chart/AbstractSeries.java
index ad43e76..4b0faa5 100644
--- a/jvsdfx-mm/src/main/java/com/pivotal/javafx/scene/chart/AbstractSeries.java
+++ b/jvsdfx-mm/src/main/java/com/pivotal/javafx/scene/chart/AbstractSeries.java
@@ -17,7 +17,7 @@ import javafx.scene.Node;
 import javafx.scene.chart.Axis;
 import javafx.scene.chart.ValueAxis;
 
-import com.pivotal.com.sun.javafx.charts.LegendItem;
+//import com.pivotal.com.sun.javafx.charts.LegendItem;
 
 /**
  * A named series of data items

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee567c31/jvsdfx-mm/src/main/java/com/pivotal/javafx/scene/chart/Series.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/javafx/scene/chart/Series.java b/jvsdfx-mm/src/main/java/com/pivotal/javafx/scene/chart/Series.java
deleted file mode 100644
index 73381d7..0000000
--- a/jvsdfx-mm/src/main/java/com/pivotal/javafx/scene/chart/Series.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package com.pivotal.javafx.scene.chart;
-
-import javafx.beans.property.ObjectProperty;
-import javafx.beans.property.ReadOnlyObjectProperty;
-import javafx.beans.property.StringProperty;
-import javafx.collections.ObservableList;
-import javafx.scene.Node;
-import javafx.scene.chart.Axis;
-
-import com.pivotal.com.sun.javafx.charts.LegendItem;
-
-public interface Series<X, Y> {
-
-  public abstract void setChart(MultiAxisChart<X, Y> value);
-
-  public abstract MultiAxisChart<X, Y> getChart();
-
-  public abstract ReadOnlyObjectProperty<MultiAxisChart<X, Y>> chartProperty();
-
-  public abstract Axis<Y> getYAxis();
-  
-  // TODO change axis event
-  public abstract void setYAxis(Axis<Y> value);
-
-  public abstract ReadOnlyObjectProperty<Axis<Y>> yAxisProperty();
-
-  public abstract void setLegendItem(LegendItem value);
-
-  public abstract LegendItem getLegendItem();
-
-  public abstract ReadOnlyObjectProperty<LegendItem> legendItemProperty();
-
-  public abstract String getName();
-
-  public abstract void setName(String value);
-
-  public abstract StringProperty nameProperty();
-
-  public abstract Node getNode();
-
-  public abstract void setNode(Node value);
-
-  public abstract ObjectProperty<Node> nodeProperty();
-
-  public abstract ObservableList<Data<X, Y>> getData();
-
-  public abstract void setData(ObservableList<Data<X, Y>> value);
-
-  public abstract ObjectProperty<ObservableList<Data<X, Y>>> dataProperty();
-
-  /**
-   * Returns a string representation of this {@code Series} object.
-   * 
-   * @return a string representation of this {@code Series} object.
-   */
-  public abstract String toString();
-
-//  public abstract void removeDataItemRef(Data<X, Y> item);
-
-  public abstract int getItemIndex(Data<X, Y> item);
-
-  public abstract int getDataSize();
-
-  public abstract String getDefaultColorStyleClass();
-
-  public abstract void setDefaultColorStyleClass(String defaultColorStyleClass);
-
-//  public abstract Data<X, Y> getBegin();
-//
-//  public abstract void setBegin(Data<X, Y> begin);
-
-  public abstract Series<X, Y> getNext();
-
-  public abstract void setNext(Series<X, Y> next);
-
-  public abstract Iterable<Data<X, Y>> getVisibleData();
-
-//  public abstract Iterable<Data<X, Y>> getData(int from, int to, int limit);
-
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee567c31/jvsdfx-mm/src/main/java/com/pivotal/jvsd/controller/RootController.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/controller/RootController.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/controller/RootController.java
index 667e9e0..a5692af 100644
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/controller/RootController.java
+++ b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/controller/RootController.java
@@ -1,10 +1,12 @@
 package com.pivotal.jvsd.controller;
 
 import com.pivotal.jvsd.fx.ChartManager;
+import com.pivotal.jvsd.fx.Main;
 import com.pivotal.jvsd.fx.StatFileManager;
 import com.pivotal.jvsd.model.ResourceWrapper;
 import com.pivotal.jvsd.model.stats.StatArchiveFile;
 import com.pivotal.jvsd.model.stats.StatArchiveFile.StatValue;
+import java.io.File;
 import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
 import javafx.fxml.FXML;
@@ -24,6 +26,11 @@ import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 import java.util.ResourceBundle;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javafx.event.ActionEvent;
+import javafx.scene.control.MenuItem;
+import javafx.stage.FileChooser;
 
 /**
  * @author Jens Deppe
@@ -84,12 +91,7 @@ public class RootController implements Initializable {
 
     resources = FXCollections.observableArrayList();
 
-    int row = 0;
-    for (StatArchiveFile s : fileManager.getArchives()) {
-      for (StatArchiveFile.ResourceInst r : s.getResourceInstList()) {
-        resources.add(new ResourceWrapper(r, row++));
-      }
-    }
+        updateArchives();
 
     tableView.setItems(resources);
     tableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
@@ -110,6 +112,15 @@ public class RootController implements Initializable {
     chartCombo.setItems(chartList);
   }
 
+    private void updateArchives() {
+        int row = 0;
+        for (StatArchiveFile s : fileManager.getArchives()) {
+            for (StatArchiveFile.ResourceInst r : s.getResourceInstList()) {
+                resources.add(new ResourceWrapper(r, row++));
+            }
+        }
+    }
+
   private List<StatValue> getSelectedStatValues() {
     List<StatValue> result = new ArrayList<>();
 
@@ -158,6 +169,26 @@ public class RootController implements Initializable {
     }
   }
 
+  @FXML
+  private void handleOpenMenuAction(ActionEvent e){
+      try {
+          FileChooser fileChooser = new FileChooser();
+          fileChooser.setTitle("Open Statistics File");
+          File file=fileChooser.showOpenDialog(null);
+          StatFileManager.getInstance().add(file.getCanonicalPath());
+          updateArchives();
+      } catch (IOException ex) {
+          //TODO needs warning dialog of failed file open.
+      }
+  }
+  
+  @FXML
+  private void handleCloseMenuAction(ActionEvent e){
+    //TODO do a real clean up and shutdown   
+    //just kill it now
+      System.exit(0);
+  }
+  
   public void setChartList(Collection<Integer> chartList) {
     if (chartList.size() > 0) {
       chartCombo.setDisable(false);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee567c31/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/Main.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/Main.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/Main.java
index cd4c7f7..0244c79 100644
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/Main.java
+++ b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/Main.java
@@ -40,5 +40,6 @@ public class Main extends Application {
   public static void main(String[] args) throws IOException {
     StatFileManager.getInstance().add(args);
     launch(args);
-  }
+  } 
 }
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee567c31/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/StatFileManager.java
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/StatFileManager.java b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/StatFileManager.java
index 17fc41a..aaabc33 100644
--- a/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/StatFileManager.java
+++ b/jvsdfx-mm/src/main/java/com/pivotal/jvsd/fx/StatFileManager.java
@@ -30,6 +30,10 @@ public class StatFileManager {
       statFiles.add(new StatArchiveFile(name));
     }
   }
+  
+  public void add(String fileName) throws IOException {
+      statFiles.add(new StatArchiveFile(fileName));
+  }
 
   public List<StatArchiveFile> getArchives() {
     return statFiles;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ee567c31/jvsdfx-mm/src/main/resources/jvsd.fxml
----------------------------------------------------------------------
diff --git a/jvsdfx-mm/src/main/resources/jvsd.fxml b/jvsdfx-mm/src/main/resources/jvsd.fxml
index 46ce5f5..17657ca 100644
--- a/jvsdfx-mm/src/main/resources/jvsd.fxml
+++ b/jvsdfx-mm/src/main/resources/jvsd.fxml
@@ -25,8 +25,9 @@
       <menus>
         <Menu mnemonicParsing="false" text="File">
           <items>
-                  <MenuItem mnemonicParsing="false" text="Open" />
-            <MenuItem mnemonicParsing="false" text="Close" />
+                  <MenuItem mnemonicParsing="false" text="Open" onAction="#handleOpenMenuAction"/>
+                  
+            <MenuItem mnemonicParsing="false" text="Close" onAction="#handleCloseMenuAction"/>
           </items>
         </Menu>
         <Menu mnemonicParsing="false" text="Edit">