├── .github ├── FUNDING.yml └── workflows │ └── maven.yml ├── .gitignore ├── LICENSE ├── README.md ├── js ├── README.txt ├── build.sh ├── orsoncharts.js └── src │ ├── KeyedValue3DLabels.js │ ├── KeyedValueLabels.js │ ├── KeyedValues3DDataset.js │ ├── KeyedValuesDataset.js │ ├── Utils.js │ ├── XYZDataset.js │ └── XYZLabels.js ├── pom.xml ├── src ├── main │ ├── java │ │ ├── module-info.java │ │ └── org │ │ │ └── jfree │ │ │ └── chart3d │ │ │ ├── Chart3D.java │ │ │ ├── Chart3DChangeEvent.java │ │ │ ├── Chart3DChangeListener.java │ │ │ ├── Chart3DFactory.java │ │ │ ├── Chart3DHints.java │ │ │ ├── Chart3DPanel.java │ │ │ ├── ChartElement.java │ │ │ ├── ChartElementVisitor.java │ │ │ ├── Colors.java │ │ │ ├── Orientation.java │ │ │ ├── Resources.java │ │ │ ├── TitleAnchor.java │ │ │ ├── TitleUtils.java │ │ │ ├── axis │ │ │ ├── AbstractAxis3D.java │ │ │ ├── AbstractValueAxis3D.java │ │ │ ├── Axis3D.java │ │ │ ├── Axis3DChangeEvent.java │ │ │ ├── Axis3DChangeListener.java │ │ │ ├── CategoryAxis3D.java │ │ │ ├── IntegerTickSelector.java │ │ │ ├── LabelOrientation.java │ │ │ ├── LogAxis3D.java │ │ │ ├── NumberAxis3D.java │ │ │ ├── NumberTickSelector.java │ │ │ ├── StandardCategoryAxis3D.java │ │ │ ├── TickData.java │ │ │ ├── TickSelector.java │ │ │ ├── ValueAxis3D.java │ │ │ ├── ValueAxis3DType.java │ │ │ └── package-info.java │ │ │ ├── data │ │ │ ├── AbstractDataset3D.java │ │ │ ├── DataUtils.java │ │ │ ├── Dataset3D.java │ │ │ ├── Dataset3DChangeEvent.java │ │ │ ├── Dataset3DChangeListener.java │ │ │ ├── DefaultKeyedValue.java │ │ │ ├── DefaultKeyedValues.java │ │ │ ├── DefaultKeyedValues2D.java │ │ │ ├── DefaultKeyedValues3D.java │ │ │ ├── ItemKey.java │ │ │ ├── JSONUtils.java │ │ │ ├── KeyedValue.java │ │ │ ├── KeyedValues.java │ │ │ ├── KeyedValues2D.java │ │ │ ├── KeyedValues3D.java │ │ │ ├── KeyedValues3DItemKey.java │ │ │ ├── KeyedValues3DItemKeys.java │ │ │ ├── KeyedValuesItemKey.java │ │ │ ├── NullConversion.java │ │ │ ├── PieDataset3D.java │ │ │ ├── Range.java │ │ │ ├── Series3DChangeEvent.java │ │ │ ├── Series3DChangeListener.java │ │ │ ├── StandardPieDataset3D.java │ │ │ ├── Values.java │ │ │ ├── Values2D.java │ │ │ ├── Values3D.java │ │ │ ├── category │ │ │ │ ├── CategoryDataset3D.java │ │ │ │ ├── StandardCategoryDataset3D.java │ │ │ │ └── package-info.java │ │ │ ├── function │ │ │ │ ├── Function3D.java │ │ │ │ ├── Function3DUtils.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── xyz │ │ │ │ ├── XYZDataItem.java │ │ │ │ ├── XYZDataset.java │ │ │ │ ├── XYZDatasetUtils.java │ │ │ │ ├── XYZItemKey.java │ │ │ │ ├── XYZItemKeys.java │ │ │ │ ├── XYZSeries.java │ │ │ │ ├── XYZSeriesCollection.java │ │ │ │ └── package-info.java │ │ │ ├── export │ │ │ ├── ExportFormat.java │ │ │ ├── ExportFormats.java │ │ │ ├── ExportUtils.java │ │ │ └── package-info.java │ │ │ ├── graphics2d │ │ │ ├── Anchor2D.java │ │ │ ├── Fit2D.java │ │ │ ├── RefPt2D.java │ │ │ ├── Scale2D.java │ │ │ ├── TextAnchor.java │ │ │ └── package-info.java │ │ │ ├── graphics3d │ │ │ ├── DefaultDrawable3D.java │ │ │ ├── Dimension3D.java │ │ │ ├── Dot3D.java │ │ │ ├── DoubleSidedFace.java │ │ │ ├── Drawable3D.java │ │ │ ├── Face.java │ │ │ ├── LabelFace.java │ │ │ ├── Line3D.java │ │ │ ├── LineObject3D.java │ │ │ ├── Object3D.java │ │ │ ├── Offset2D.java │ │ │ ├── Offset3D.java │ │ │ ├── Point3D.java │ │ │ ├── RenderedElement.java │ │ │ ├── RenderingInfo.java │ │ │ ├── Rotate3D.java │ │ │ ├── ViewPoint3D.java │ │ │ ├── World.java │ │ │ ├── internal │ │ │ │ ├── FaceSorter.java │ │ │ │ ├── StandardFaceSorter.java │ │ │ │ ├── TaggedFace.java │ │ │ │ ├── Utils2D.java │ │ │ │ ├── Utils3D.java │ │ │ │ └── ZOrderComparator.java │ │ │ ├── package-info.java │ │ │ └── swing │ │ │ │ ├── DisplayPanel3D.java │ │ │ │ ├── DownAction.java │ │ │ │ ├── ExportToJPEGAction.java │ │ │ │ ├── ExportToPDFAction.java │ │ │ │ ├── ExportToPNGAction.java │ │ │ │ ├── ExportToSVGAction.java │ │ │ │ ├── LeftAction.java │ │ │ │ ├── Panel3D.java │ │ │ │ ├── RightAction.java │ │ │ │ ├── RollLeftAction.java │ │ │ │ ├── RollRightAction.java │ │ │ │ ├── UpAction.java │ │ │ │ ├── ZoomInAction.java │ │ │ │ ├── ZoomOutAction.java │ │ │ │ ├── ZoomToFitAction.java │ │ │ │ └── package-info.java │ │ │ ├── interaction │ │ │ ├── Chart3DMouseEvent.java │ │ │ ├── Chart3DMouseListener.java │ │ │ ├── InteractiveElementType.java │ │ │ ├── KeyedValues3DItemSelection.java │ │ │ ├── StandardKeyedValues3DItemSelection.java │ │ │ ├── StandardXYZDataItemSelection.java │ │ │ ├── XYZDataItemSelection.java │ │ │ └── package-info.java │ │ │ ├── internal │ │ │ ├── Args.java │ │ │ ├── ChartBox3D.java │ │ │ ├── ObjectUtils.java │ │ │ ├── OnDrawHandler.java │ │ │ ├── SerialUtils.java │ │ │ └── TextUtils.java │ │ │ ├── label │ │ │ ├── CategoryItemLabelGenerator.java │ │ │ ├── CategoryLabelGenerator.java │ │ │ ├── ItemLabelPositioning.java │ │ │ ├── PieLabelGenerator.java │ │ │ ├── StandardCategoryItemLabelGenerator.java │ │ │ ├── StandardCategoryLabelGenerator.java │ │ │ ├── StandardPieLabelGenerator.java │ │ │ ├── StandardXYZItemLabelGenerator.java │ │ │ ├── StandardXYZLabelGenerator.java │ │ │ ├── XYZItemLabelGenerator.java │ │ │ ├── XYZLabelGenerator.java │ │ │ └── package-info.java │ │ │ ├── legend │ │ │ ├── ColorScaleElement.java │ │ │ ├── ColorScaleLegendBuilder.java │ │ │ ├── LegendAnchor.java │ │ │ ├── LegendBuilder.java │ │ │ ├── LegendItemInfo.java │ │ │ ├── StandardLegendBuilder.java │ │ │ ├── StandardLegendItemInfo.java │ │ │ └── package-info.java │ │ │ ├── marker │ │ │ ├── AbstractMarker.java │ │ │ ├── CategoryMarker.java │ │ │ ├── CategoryMarkerType.java │ │ │ ├── Marker.java │ │ │ ├── MarkerChangeEvent.java │ │ │ ├── MarkerChangeListener.java │ │ │ ├── MarkerData.java │ │ │ ├── MarkerDataType.java │ │ │ ├── MarkerLine.java │ │ │ ├── NumberMarker.java │ │ │ ├── RangeMarker.java │ │ │ ├── ValueMarker.java │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── plot │ │ │ ├── AbstractPlot3D.java │ │ │ ├── CategoryPlot3D.java │ │ │ ├── ColorSource.java │ │ │ ├── FontSource.java │ │ │ ├── PiePlot3D.java │ │ │ ├── Plot3D.java │ │ │ ├── Plot3DChangeEvent.java │ │ │ ├── Plot3DChangeListener.java │ │ │ ├── StandardColorSource.java │ │ │ ├── StandardFontSource.java │ │ │ ├── XYZPlot.java │ │ │ └── package-info.java │ │ │ ├── renderer │ │ │ ├── AbstractColorScale.java │ │ │ ├── AbstractRenderer3D.java │ │ │ ├── ColorScale.java │ │ │ ├── ColorScaleRenderer.java │ │ │ ├── ComposeType.java │ │ │ ├── FixedColorScale.java │ │ │ ├── GradientColorScale.java │ │ │ ├── RainbowScale.java │ │ │ ├── Renderer3D.java │ │ │ ├── Renderer3DChangeEvent.java │ │ │ ├── Renderer3DChangeListener.java │ │ │ ├── category │ │ │ │ ├── AbstractCategoryRenderer3D.java │ │ │ │ ├── AreaRenderer3D.java │ │ │ │ ├── BarRenderer3D.java │ │ │ │ ├── CategoryColorSource.java │ │ │ │ ├── CategoryRenderer3D.java │ │ │ │ ├── LineRenderer3D.java │ │ │ │ ├── StackedBarRenderer3D.java │ │ │ │ ├── StandardCategoryColorSource.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── xyz │ │ │ │ ├── AbstractXYZRenderer.java │ │ │ │ ├── BarXYZRenderer.java │ │ │ │ ├── LineXYZRenderer.java │ │ │ │ ├── ScatterXYZRenderer.java │ │ │ │ ├── StandardXYZColorSource.java │ │ │ │ ├── SurfaceRenderer.java │ │ │ │ ├── XYZColorSource.java │ │ │ │ ├── XYZRenderer.java │ │ │ │ └── package-info.java │ │ │ ├── style │ │ │ ├── ChartStyle.java │ │ │ ├── ChartStyleChangeEvent.java │ │ │ ├── ChartStyleChangeListener.java │ │ │ ├── ChartStyler.java │ │ │ ├── ChartStyles.java │ │ │ ├── StandardChartStyle.java │ │ │ └── package-info.java │ │ │ ├── table │ │ │ ├── AbstractTableElement.java │ │ │ ├── ContainerElement.java │ │ │ ├── ElementDimension.java │ │ │ ├── ElementInfo.java │ │ │ ├── FlowElement.java │ │ │ ├── GradientRectanglePainter.java │ │ │ ├── GridElement.java │ │ │ ├── HAlign.java │ │ │ ├── RectanglePainter.java │ │ │ ├── ShapeElement.java │ │ │ ├── StandardRectanglePainter.java │ │ │ ├── TableElement.java │ │ │ ├── TableElementOnDraw.java │ │ │ ├── TableElementStyler.java │ │ │ ├── TableElementVisitor.java │ │ │ ├── TextElement.java │ │ │ ├── VAlign.java │ │ │ ├── VerticalFlowElement.java │ │ │ └── package-info.java │ │ │ └── util │ │ │ └── json │ │ │ ├── JSONArray.java │ │ │ ├── JSONAware.java │ │ │ ├── JSONObject.java │ │ │ ├── JSONStreamAware.java │ │ │ ├── JSONValue.java │ │ │ ├── package-info.java │ │ │ └── parser │ │ │ ├── ContainerFactory.java │ │ │ ├── ContentHandler.java │ │ │ ├── JSONParser.java │ │ │ ├── ParseException.java │ │ │ ├── Yylex.java │ │ │ ├── Yytoken.java │ │ │ └── package-info.java │ ├── javadoc │ │ ├── doc-files │ │ │ ├── AreaChart3DDemo1.svg │ │ │ ├── BarChart3DDemo1.svg │ │ │ ├── LineChart3DDemo1.svg │ │ │ ├── PieChart3DDemo1.svg │ │ │ ├── ScatterPlot3DDemo1.svg │ │ │ ├── ScatterPlot3DDemo2.svg │ │ │ ├── StackedBarChart3DDemo1.svg │ │ │ ├── SurfaceRendererDemo2.svg │ │ │ └── XYZBarChart3DDemo1.svg │ │ └── org │ │ │ └── jfree │ │ │ └── chart3d │ │ │ └── renderer │ │ │ └── doc-files │ │ │ └── BarRenderer3D.svg │ └── resources │ │ └── org │ │ └── jfree │ │ └── chart3d │ │ ├── Resources.properties │ │ ├── Resources_de.properties │ │ ├── Resources_it.properties │ │ └── graphics3d │ │ └── swing │ │ └── fontawesome-webfont.ttf └── test │ └── java │ └── org │ └── jfree │ └── chart3d │ ├── Chart3DTest.java │ ├── TestUtils.java │ ├── axis │ ├── LogAxis3DTest.java │ ├── NumberAxis3DTest.java │ ├── NumberTickSelectorTest.java │ └── StandardCategoryAxis3DTest.java │ ├── data │ ├── DataUtilsTest.java │ ├── DataValuesTest.java │ ├── DefaultKeyedValueTest.java │ ├── DefaultKeyedValues2DTest.java │ ├── DefaultKeyedValues3DTest.java │ ├── DefaultKeyedValuesTest.java │ ├── JSONUtilsTest.java │ ├── KeyedValues3DItemKeyTest.java │ ├── KeyedValuesItemKeyTest.java │ ├── RangeTest.java │ ├── StandardPieDataset3DTest.java │ ├── category │ │ └── StandardCategoryDataset3DTest.java │ └── xyz │ │ ├── XYZDataItemTest.java │ │ ├── XYZItemKeyTest.java │ │ ├── XYZSeriesCollectionTest.java │ │ └── XYZSeriesTest.java │ ├── graphics2d │ ├── Anchor2DTest.java │ ├── Fit2DTest.java │ └── Offset2DTest.java │ ├── graphics3d │ ├── Dimension3DTest.java │ ├── Point3DTest.java │ ├── Rotate3DTest.java │ ├── ViewPoint3DTest.java │ └── internal │ │ └── Utils3DTest.java │ ├── interaction │ └── StandardKeyedValues3DItemSelectionTest.java │ ├── label │ ├── StandardCategoryItemLabelGeneratorTest.java │ ├── StandardCategoryLabelGeneratorTest.java │ ├── StandardPieLabelGeneratorTest.java │ └── StandardXYZLabelGeneratorTest.java │ ├── legend │ ├── ColorScaleElementTest.java │ ├── ColorScaleLegendBuilderTest.java │ └── StandardLegendBuilderTest.java │ ├── marker │ ├── CategoryMarkerTest.java │ ├── NumberMarkerTest.java │ └── RangeMarkerTest.java │ ├── plot │ ├── CategoryPlot3DTest.java │ ├── PiePlot3DTest.java │ ├── StandardColorSourceTest.java │ └── XYZPlotTest.java │ ├── renderer │ ├── FixedColorScaleTest.java │ ├── GradientColorScaleTest.java │ ├── RainbowScaleTest.java │ ├── category │ │ ├── AreaRenderer3DTest.java │ │ ├── BarRenderer3DTest.java │ │ ├── LineRenderer3DTest.java │ │ ├── StackedBarRenderer3DTest.java │ │ └── StandardCategoryColorSourceTest.java │ └── xyz │ │ ├── BarXYZRendererTest.java │ │ ├── ScatterXYZRendererTest.java │ │ ├── StandardXYZColorSourceTest.java │ │ └── SurfaceRendererTest.java │ ├── style │ └── StandardChartStyleTest.java │ ├── table │ ├── ElementDimensionTest.java │ ├── FlowElementTest.java │ ├── GradientRectanglePainterTest.java │ ├── GridElementTest.java │ ├── StandardRectanglePainterTest.java │ ├── TextElementTest.java │ └── VerticalFlowElementTest.java │ └── util │ └── ObjectUtilsTest.java └── svg ├── SVGDemo1.html ├── css └── opentip.css └── lib ├── opentip-native.js └── orsoncharts.js /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [jfree] 4 | -------------------------------------------------------------------------------- /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven 3 | 4 | # This workflow uses actions that are not certified by GitHub. 5 | # They are provided by a third-party and are governed by 6 | # separate terms of service, privacy policy, and support 7 | # documentation. 8 | 9 | name: Java CI with Maven 10 | 11 | on: 12 | push: 13 | branches: [ "master" ] 14 | pull_request: 15 | branches: [ "master" ] 16 | workflow_dispatch: 17 | 18 | jobs: 19 | build: 20 | 21 | runs-on: ubuntu-latest 22 | 23 | steps: 24 | - uses: actions/checkout@v4 25 | - name: Set up JDK 21 26 | uses: actions/setup-java@v4 27 | with: 28 | java-version: '21' 29 | distribution: 'temurin' 30 | cache: maven 31 | server-id: central 32 | server-username: MAVEN_USERNAME 33 | server-password: MAVEN_PASSWORD 34 | - name: Build and publish with Maven 35 | run: mvn --batch-mode deploy --file pom.xml 36 | env: 37 | MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} 38 | MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Package Files # 4 | *.jar 5 | *.war 6 | *.ear 7 | /target/ 8 | *.DS_Store 9 | .idea 10 | nb-configuration.xml 11 | nbactions.xml -------------------------------------------------------------------------------- /js/README.txt: -------------------------------------------------------------------------------- 1 | JavaScript Utilities 2 | -------------------- 3 | 4 | This directory contains some JavaScript utility code that can be used when exporting charts to SVG format with JFreeSVG. The build.sh script will build the library, but note that it requires the Google Closure Compiler jar file to be on the classpath (please edit the script accordingly). 5 | 6 | https://developers.google.com/closure/compiler/ 7 | 8 | Look in the 'svg' directory (open SVGDemo1.html) to see a demo that uses this JavaScript code. 9 | -------------------------------------------------------------------------------- /js/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | java -jar ~/jars/compiler.jar --warning_level VERBOSE --compilation_level WHITESPACE_ONLY \ 4 | --js src/Utils.js \ 5 | --js src/KeyedValuesDataset.js \ 6 | --js src/KeyedValues3DDataset.js \ 7 | --js src/XYZDataset.js \ 8 | --js src/KeyedValueLabels.js \ 9 | --js src/KeyedValue3DLabels.js \ 10 | --js src/XYZLabels.js \ 11 | --js_output_file orsoncharts.js -------------------------------------------------------------------------------- /js/src/KeyedValue3DLabels.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Orson Charts 3 | * ------------ 4 | * Copyright 2014-2022 by David Gilbert. 5 | */ 6 | 7 | "use strict"; 8 | 9 | if (!orsoncharts) orsoncharts = {}; 10 | 11 | /** 12 | * Constructor for a new KeyedValue3DLabels instance 13 | * @constructor 14 | */ 15 | orsoncharts.KeyedValue3DLabels = function() { 16 | if (!(this instanceof orsoncharts.KeyedValue3DLabels)) { 17 | return new orsoncharts.KeyedValue3DLabels(); 18 | } 19 | this.format = "{S}, {R}, {C} = {V}"; 20 | this.valueDP = 2; 21 | }; 22 | 23 | // Generates a label for an item in a KeyedValue3DDataset. 24 | orsoncharts.KeyedValue3DLabels.prototype.itemLabel = function(keyedValues3D, 25 | seriesIndex, rowIndex, columnIndex) { 26 | var labelStr = new String(this.format); 27 | var seriesKeyStr = keyedValues3D.seriesKey(seriesIndex); 28 | var rowKeyStr = keyedValues3D.rowKey(rowIndex); 29 | var columnKeyStr = keyedValues3D.columnKey(columnIndex); 30 | var value = keyedValues3D.valueByIndex(seriesIndex, rowIndex, columnIndex); 31 | var valueStr = value.toFixed(this.valueDP); 32 | labelStr = labelStr.replace(/{S}/g, seriesKeyStr); 33 | labelStr = labelStr.replace(/{R}/g, rowKeyStr); 34 | labelStr = labelStr.replace(/{C}/g, columnKeyStr); 35 | labelStr = labelStr.replace(/{V}/g, valueStr); 36 | return labelStr; 37 | }; -------------------------------------------------------------------------------- /js/src/KeyedValueLabels.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Orson Charts 3 | * ------------ 4 | * Copyright 2014-2022 by David Gilbert. 5 | */ 6 | 7 | "use strict"; 8 | 9 | if (!orsoncharts) orsoncharts = {}; 10 | 11 | /** 12 | * Constructor for a new KeyedValueLabels instance 13 | * @constructor 14 | */ 15 | orsoncharts.KeyedValueLabels = function() { 16 | if (!(this instanceof orsoncharts.KeyedValueLabels)) { 17 | return new orsoncharts.KeyedValueLabels(); 18 | } 19 | this.format = "{K} = {V}"; 20 | this.valueDP = 2; 21 | this.percentDP = 2; 22 | }; 23 | 24 | // Generates a label for an item in a KeyedValuesDataset. 25 | orsoncharts.KeyedValueLabels.prototype.itemLabel = function(keyedValues, itemIndex) { 26 | var labelStr = new String(this.format); 27 | var keyStr = keyedValues.key(itemIndex); 28 | var value = keyedValues.valueByIndex(itemIndex); 29 | var valueStr = value.toFixed(this.valueDP); 30 | var total = keyedValues.total(); 31 | var percentStr = (value / total * 100).toFixed(this.percentDP); 32 | labelStr = labelStr.replace(/{K}/g, keyStr); 33 | labelStr = labelStr.replace(/{V}/g, valueStr); 34 | labelStr = labelStr.replace(/{P}/g, percentStr); 35 | return labelStr; 36 | }; 37 | -------------------------------------------------------------------------------- /js/src/Utils.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2022 by David Gilbert. 3 | */ 4 | 5 | var orsoncharts; 6 | if (!orsoncharts) orsoncharts = {}; 7 | 8 | orsoncharts.Utils = {}; 9 | 10 | orsoncharts.Utils.makeArrayOf = function(value, length) { 11 | var arr = [], i = length; 12 | while (i--) { 13 | arr[i] = value; 14 | } 15 | return arr; 16 | }; 17 | 18 | // returns the chart entity reference for this element 19 | orsoncharts.Utils.findChartRef = function(element) { 20 | var id = element.getAttribute("jfreesvg:ref"); 21 | var found = false; 22 | var current = element; 23 | while (!found) { 24 | current = current.parentNode; 25 | if (current != null) { 26 | id = current.getAttribute("jfreesvg:ref"); 27 | found = (id != null); 28 | } else { 29 | found = true; 30 | } 31 | } 32 | return id; 33 | } 34 | 35 | // find the chart id by finding the group that is written for the entire chart 36 | orsoncharts.Utils.findChartId = function(element) { 37 | var id = null; 38 | var found = false; 39 | var current = element; 40 | while (!found) { 41 | current = current.parentNode; 42 | if (current != null) { 43 | var ref = current.getAttribute("jfreesvg:ref"); 44 | if (ref == 'ORSON_CHART_TOP_LEVEL') { 45 | found = true; 46 | id = current.getAttribute("id"); 47 | } 48 | } else { 49 | found = true; 50 | } 51 | } 52 | return id; 53 | } 54 | 55 | 56 | -------------------------------------------------------------------------------- /js/src/XYZLabels.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Orson Charts 3 | * ------------ 4 | * Copyright 2014-2022 by David Gilbert. 5 | */ 6 | 7 | "use strict"; 8 | 9 | if (!orsoncharts) orsoncharts = {}; 10 | 11 | /** 12 | * Constructor for a new XYZLabels instance 13 | * @constructor 14 | */ 15 | orsoncharts.XYZLabels = function() { 16 | if (!(this instanceof orsoncharts.XYZLabels)) { 17 | return new orsoncharts.XYZLabels(); 18 | } 19 | this.format = "{X}, {Y}, {Z} / {S}"; 20 | this.xDP = 2; 21 | this.yDP = 2; 22 | this.zDP = 2; 23 | }; 24 | 25 | // Generates a label for an item in a XYZDataset. 26 | orsoncharts.XYZLabels.prototype.itemLabel = function(dataset, seriesKey, itemIndex) { 27 | var labelStr = new String(this.format); 28 | var seriesKeyStr = seriesKey; 29 | var seriesIndex = dataset.seriesIndex(seriesKey); 30 | var item = dataset.item(seriesIndex, itemIndex); 31 | var xStr = item[0].toFixed(this.xDP); 32 | var yStr = item[1].toFixed(this.yDP); 33 | var zStr = item[2].toFixed(this.zDP); 34 | labelStr = labelStr.replace(/{X}/g, xStr); 35 | labelStr = labelStr.replace(/{Y}/g, yStr); 36 | labelStr = labelStr.replace(/{Z}/g, zStr); 37 | labelStr = labelStr.replace(/{S}/g, seriesKeyStr); 38 | return labelStr; 39 | }; 40 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/Chart3DChangeListener.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d; 34 | 35 | import java.util.EventListener; 36 | 37 | /** 38 | * An interface for receiving notification of changes to a {@link Chart3D} 39 | * instance. 40 | *

41 | * The {@link Chart3DPanel} class implements this interface so that it can 42 | * receive notification of changes to the chart being displayed in the 43 | * panel (whenever the chart changes, the panel is repainted). 44 | */ 45 | public interface Chart3DChangeListener extends EventListener { 46 | 47 | /** 48 | * Called to inform that a chart change event has occurred. 49 | * 50 | * @param event the event. 51 | */ 52 | void chartChanged(Chart3DChangeEvent event); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/ChartElement.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d; 34 | 35 | /** 36 | * A chart element used to implement the Visitor pattern for applying changes 37 | * to the chart. This is used by the chart styling feature. 38 | * 39 | * @since 1.2 40 | */ 41 | public interface ChartElement { 42 | 43 | /** 44 | * Receives a visitor to the element. 45 | * 46 | * @param visitor the visitor ({@code null} not permitted). 47 | */ 48 | void receive(ChartElementVisitor visitor); 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/ChartElementVisitor.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d; 34 | 35 | /** 36 | * A visitor for a {@link ChartElement}. 37 | */ 38 | public interface ChartElementVisitor { 39 | 40 | /** 41 | * Visit a chart element. 42 | * 43 | * @param element the chart element ({@code null} not permitted). 44 | */ 45 | void visit(ChartElement element); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/Orientation.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d; 34 | 35 | /** 36 | * General enumeration of orientations. One application for this is to 37 | * specify whether the legend should be created for a vertical or horizontal 38 | * layout. 39 | * 40 | * @since 1.1 41 | */ 42 | public enum Orientation { 43 | 44 | /** Horizontal orientation. */ 45 | HORIZONTAL, 46 | 47 | /** Vertical orientation. */ 48 | VERTICAL 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/axis/Axis3DChangeListener.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.axis; 34 | 35 | import java.util.EventListener; 36 | import org.jfree.chart3d.plot.CategoryPlot3D; 37 | import org.jfree.chart3d.plot.XYZPlot; 38 | 39 | /** 40 | * A listener for axis change events. The plot classes that have axes 41 | * ({@link CategoryPlot3D} and {@link XYZPlot}) implement this interface so 42 | * that they can receive notification when the axes are modified. 43 | */ 44 | public interface Axis3DChangeListener extends EventListener { 45 | 46 | /** 47 | * Called to inform that an axis change event has occurred. 48 | * 49 | * @param event the event ({@code null} not permitted). 50 | */ 51 | void axisChanged(Axis3DChangeEvent event); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/axis/LabelOrientation.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.axis; 34 | 35 | /** 36 | * The orientation of an axis label relative to the axis. 37 | */ 38 | public enum LabelOrientation { 39 | 40 | /** Labels are drawn perpendicular to the axis line. */ 41 | PERPENDICULAR, 42 | 43 | /** Labels are drawn parallel to the axis line. */ 44 | PARALLEL 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/axis/ValueAxis3DType.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.axis; 34 | 35 | import org.jfree.chart3d.plot.CategoryPlot3D; 36 | import org.jfree.chart3d.plot.XYZPlot; 37 | 38 | /** 39 | * An enumeration of the value axis types. A {@link ValueAxis3D} can be 40 | * used in several different plot dimensions. 41 | * 42 | * @since 1.3 43 | */ 44 | public enum ValueAxis3DType { 45 | 46 | /** A value axis in a {@link CategoryPlot3D}. */ 47 | VALUE, 48 | 49 | /** An x-axis in an {@link XYZPlot}. */ 50 | X, 51 | 52 | /** A y-axis in an {@link XYZPlot}. */ 53 | Y, 54 | 55 | /** A z-axis in an {@link XYZPlot}. */ 56 | Z 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/axis/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Axes ({@link org.jfree.chart3d.axis.CategoryAxis3D}, 3 | * {@link org.jfree.chart3d.axis.NumberAxis3D} and 4 | * {@link org.jfree.chart3d.axis.LogAxis3D}) plus supporting classes and 5 | * interfaces. 6 | */ 7 | package org.jfree.chart3d.axis; 8 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/Dataset3DChangeListener.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data; 34 | 35 | import java.util.EventListener; 36 | 37 | /** 38 | * The interface through which dataset change events are passed. The plot 39 | * classes implement this interface so they can receive notification of 40 | * changes to the dataset they are managing. 41 | */ 42 | public interface Dataset3DChangeListener extends EventListener { 43 | 44 | /** 45 | * Called to notify the listener that the source dataset has been 46 | * changed. 47 | * 48 | * @param event the event details. 49 | */ 50 | void datasetChanged(Dataset3DChangeEvent event); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/ItemKey.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data; 34 | 35 | /** 36 | * A key that references a single data item in a dataset. 37 | * 38 | * @since 1.3 39 | */ 40 | public interface ItemKey { 41 | 42 | /** 43 | * Returns a JSON formatted string representing the key. 44 | * 45 | * @return A JSON formatted string. 46 | */ 47 | String toJSONString(); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/KeyedValue.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data; 34 | 35 | /** 36 | * A {@code (key, value)} pair that is used as a building block for some 37 | * data structures for the charts. 38 | * 39 | * @param The key type. 40 | * @param The value type. 41 | */ 42 | public interface KeyedValue, T> { 43 | 44 | /** 45 | * Returns the key (by design, this key is required to be 46 | * non-{@code null}). 47 | * 48 | * @return The key (never {@code null}). 49 | */ 50 | K getKey(); 51 | 52 | /** 53 | * Returns the value. 54 | * 55 | * @return The value (possibly {@code null}). 56 | */ 57 | T getValue(); 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/KeyedValues.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data; 34 | 35 | import java.util.List; 36 | 37 | /** 38 | * A list of values that are associated with unique keys. 39 | * 40 | * @param the key type (must implement Comparable). 41 | * @param the value type. 42 | */ 43 | public interface KeyedValues, T> extends Values { 44 | 45 | /** 46 | * Returns the key for the specified item in the list. 47 | * 48 | * @param index the item index. 49 | * 50 | * @return The key. 51 | */ 52 | K getKey(int index); 53 | 54 | /** 55 | * Returns the index for the specified key, or {@code -1} if the key 56 | * is not present in the list. 57 | * 58 | * @param key the key ({@code null} not permitted). 59 | * 60 | * @return The item index, or {@code -1}. 61 | */ 62 | int getIndex(K key); 63 | 64 | /** 65 | * Returns a list of all the keys. Note that the list will be a copy, so 66 | * modifying it will not impact this data structure. 67 | * 68 | * @return A list of keys (possibly empty, but never {@code null}). 69 | */ 70 | List getKeys(); 71 | 72 | /** 73 | * Returns the value associated with the specified key, or 74 | * {@code null}. 75 | * 76 | * @param key the key ({@code null} not permitted). 77 | * 78 | * @return The value (possibly {@code null}). 79 | */ 80 | T getValue(K key); 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/NullConversion.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data; 34 | 35 | /** 36 | * Options for handling {@code null} values during dataset extraction 37 | * (SKIP, CONVERT_TO_NAN, CONVERT_TO_ZERO, THROW_EXCEPTION). 38 | * 39 | * @since 1.3 40 | */ 41 | public enum NullConversion { 42 | 43 | /** Skip the item that contains the {@code null} value. */ 44 | SKIP, 45 | 46 | /** Convert the {@code null} to {@code Double.NaN}. */ 47 | CONVERT_TO_NAN, 48 | 49 | /** Convert the {@code null} to zero. */ 50 | CONVERT_TO_ZERO, 51 | 52 | /** Throw a runtime exception. */ 53 | THROW_EXCEPTION 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/PieDataset3D.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data; 34 | 35 | import org.jfree.chart3d.plot.PiePlot3D; 36 | 37 | /** 38 | * The interface through which the {@link PiePlot3D} class obtains data for 39 | * pie charts. The interface defines methods for reading data only, not for 40 | * updating the data (however, classes that implement the interface will 41 | * typically provide their own methods for updating the dataset). 42 | * 43 | * @param The key type (must implement Comparable) 44 | */ 45 | public interface PieDataset3D> 46 | extends KeyedValues, Values, Dataset3D { 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/Series3DChangeEvent.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data; 34 | 35 | import java.io.Serializable; 36 | import java.util.EventObject; 37 | 38 | /** 39 | * An event that signals a change to a series (the "3D" in the name is to 40 | * differentiate this class from the similar event object in JFreeChart). 41 | * 42 | * @since 1.6 43 | */ 44 | public class Series3DChangeEvent extends EventObject implements Serializable{ 45 | 46 | /** 47 | * Constructs a new event. 48 | * 49 | * @param source the source of the change event. 50 | */ 51 | public Series3DChangeEvent(Object source) { 52 | super(source); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/Series3DChangeListener.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data; 34 | 35 | import java.util.EventListener; 36 | 37 | /** 38 | * Methods for receiving notification of changes to a data series. 39 | * 40 | * @since 1.6 41 | */ 42 | public interface Series3DChangeListener extends EventListener { 43 | 44 | /** 45 | * Called when an observed series changes in some way. 46 | * 47 | * @param event information about the change. 48 | */ 49 | void seriesChanged(Series3DChangeEvent event); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/Values.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data; 34 | 35 | /** 36 | * A generic representation of a one dimensional list of data values. 37 | * 38 | * @param The value type. 39 | */ 40 | public interface Values { 41 | 42 | /** 43 | * Returns the number of items in the dataset. 44 | * 45 | * @return The number of items in the dataset. 46 | */ 47 | int getItemCount(); 48 | 49 | /** 50 | * Returns the value for the specified item. 51 | * 52 | * @param item the item index. 53 | * 54 | * @return The value for the specified item (possibly {@code null}). 55 | */ 56 | T getValue(int item); 57 | 58 | /** 59 | * Returns the value for the specified item as a double primitive, provided 60 | * that the data type is a subclass of {@code Number}. Where 61 | * the {@link #getValue(int)} method returns {@code null}, this method 62 | * returns {@code Double.NaN}. 63 | * 64 | * @param item the item index. 65 | * 66 | * @return The value for the specified item. 67 | */ 68 | double getDoubleValue(int item); 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/Values2D.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data; 34 | 35 | /** 36 | * A generic representation of a two-dimensional grid of data values. 37 | * 38 | * @param the type of value stored in the grid. 39 | */ 40 | public interface Values2D { 41 | 42 | /** 43 | * Returns the number of rows in the grid. 44 | * 45 | * @return The number of rows in the grid. 46 | */ 47 | int getRowCount(); 48 | 49 | /** 50 | * Returns the number of columns in the grid. 51 | * 52 | * @return The number of columns in the grid. 53 | */ 54 | int getColumnCount(); 55 | 56 | /** 57 | * Returns the data item at the specified position. 58 | * 59 | * @param rowIndex the row index. 60 | * @param columnIndex the column index. 61 | * 62 | * @return The data value (possibly {@code null}). 63 | */ 64 | T getValue(int rowIndex, int columnIndex); 65 | 66 | /** 67 | * Returns the data value at the specified position as a double primitive, 68 | * or {@code Double.NaN} if the value is not an instance of 69 | * {@code Number}. Where the {@link #getValue(int, int)} method 70 | * returns {@code null}, this method returns {@code Double.NaN}. 71 | * 72 | * @param rowIndex the row index. 73 | * @param columnIndex the column index. 74 | * 75 | * @return The data value. 76 | */ 77 | double getDoubleValue(int rowIndex, int columnIndex); 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/category/CategoryDataset3D.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data.category; 34 | 35 | import org.jfree.chart3d.data.Dataset3D; 36 | import org.jfree.chart3d.data.KeyedValues3D; 37 | import org.jfree.chart3d.plot.CategoryPlot3D; 38 | 39 | /** 40 | * An interface for a dataset with multiple series of data in the form of 41 | * {@code (rowKey, columnKey, value)}. This is the standard data 42 | * interface used by the {@link CategoryPlot3D} class. 43 | * 44 | * @param the series key type (must implement Comparable) 45 | * @param the row key type (must implement Comparable) 46 | * @param the column key type (must implement Comparable) 47 | */ 48 | public interface CategoryDataset3D, 49 | R extends Comparable, C extends Comparable> 50 | extends KeyedValues3D, Dataset3D { 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/category/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Datasets that can be used by the {@link org.jfree.chart3d.plot.CategoryPlot3D} 3 | * class. 4 | */ 5 | package org.jfree.chart3d.data.category; -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/function/Function3D.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data.function; 34 | 35 | import java.io.Serializable; 36 | import org.jfree.chart3d.data.Range; 37 | import org.jfree.chart3d.data.xyz.XYZDatasetUtils; 38 | 39 | /** 40 | * Represents a function {@code y = f(x, z)}. 41 | *

42 | * A dataset can be created by sampling a function - see the 43 | * {@link XYZDatasetUtils#sampleFunction(Function3D, String, Range, double, Range, double)} 44 | * method. In addition, any {@code Function3D} instance can be plotted 45 | * by a {@link org.jfree.chart3d.renderer.xyz.SurfaceRenderer}. 46 | */ 47 | public interface Function3D extends Serializable { 48 | 49 | /** 50 | * Returns the value of the function ('y') for the specified inputs ('x' 51 | * and 'z'). 52 | * 53 | * @param x the x-value. 54 | * @param z the z-value. 55 | * 56 | * @return The function value. 57 | */ 58 | double getValue(double x, double z); 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/function/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Representation of functions in the form {@code y = f(x, z)}. 3 | */ 4 | package org.jfree.chart3d.data.function; 5 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Core data structures used as the building blocks for datasets in Orson 3 | * Charts. The {@link org.jfree.chart3d.data.DataUtils} class provides important 4 | * static utility methods for working with data. 5 | */ 6 | package org.jfree.chart3d.data; 7 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/xyz/XYZItemKeys.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data.xyz; 34 | 35 | import org.jfree.chart3d.internal.Args; 36 | import java.util.ArrayList; 37 | import java.util.Collection; 38 | 39 | /** 40 | * Utility methods. 41 | * 42 | * @since 1.3 43 | */ 44 | public class XYZItemKeys { 45 | 46 | /** 47 | * Returns a collection of item keys extracted from one series in the 48 | * specified dataset. 49 | * 50 | * @param dataset the dataset ({@code null} not permitted). 51 | * @param seriesKey the series key ({@code null} not permitted). 52 | * 53 | * @param the type of the series key. 54 | * 55 | * @return A boolean. 56 | */ 57 | public static > Collection> 58 | itemKeysForSeries(XYZDataset dataset, S seriesKey) { 59 | Args.nullNotPermitted(dataset, "dataset"); 60 | Args.nullNotPermitted(seriesKey, "seriesKey"); 61 | Collection> result = new ArrayList<>(); 62 | int seriesIndex = dataset.getSeriesIndex(seriesKey); 63 | if (seriesIndex > 0) { 64 | return result; 65 | } 66 | for (int i = 0; i < dataset.getItemCount(seriesIndex); i++) { 67 | XYZItemKey key = new XYZItemKey<>(seriesKey, i); 68 | result.add(key); 69 | } 70 | return result; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/data/xyz/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Datasets that can be used by the {@link org.jfree.chart3d.plot.XYZPlot} 3 | * class. 4 | */ 5 | package org.jfree.chart3d.data.xyz; 6 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/export/ExportFormat.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.export; 34 | 35 | /** 36 | * An enumeration of the different export formats supported by Orson Charts. 37 | * PNG and JPEG export are provided by the Java standard library. PDF export 38 | * is enabled when JFreePDF is available on the classpath, and SVG export is 39 | * enabled when JFreeSVG is available on the classpath. 40 | * 41 | * @since 1.2 42 | */ 43 | public enum ExportFormat { 44 | 45 | /** The PNG image format. */ 46 | PNG, 47 | 48 | /** The JPEG image format. */ 49 | JPEG, 50 | 51 | /** The Acrobat Portable Document Format. */ 52 | PDF, 53 | 54 | /** The Scalable Vector Graphics format. */ 55 | SVG 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/export/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes for exporting charts. 3 | */ 4 | package org.jfree.chart3d.export; 5 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/graphics2d/Scale2D.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics2d; 34 | 35 | /** 36 | * Scaling options for fitting rectangles. 37 | */ 38 | public enum Scale2D { 39 | 40 | /** No scaling. */ 41 | NONE, 42 | 43 | /** Scale horizontally (but not vertically). */ 44 | SCALE_HORIZONTAL, 45 | 46 | /** Scale vertically (but not horizontally). */ 47 | SCALE_VERTICAL, 48 | 49 | /** Scale both horizontally and vertically. */ 50 | SCALE_BOTH 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/graphics2d/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Utility classes related to 2D graphics. 3 | */ 4 | package org.jfree.chart3d.graphics2d; 5 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/graphics3d/Dot3D.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics3d; 34 | 35 | import java.awt.Color; 36 | 37 | /** 38 | * A 3D object that is simply a dot (single vertex). 39 | */ 40 | public class Dot3D extends Object3D { 41 | 42 | /** 43 | * Creates a new {@code Dot3D} instance. 44 | * 45 | * @param x the x-coordinate. 46 | * @param y the y-coordinate. 47 | * @param z the z-coordinate. 48 | * @param color the color ({@code null} not permitted). 49 | */ 50 | public Dot3D(float x, float y, float z, Color color) { 51 | super(color); 52 | addVertex(new Point3D(x, y, z)); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/graphics3d/DoubleSidedFace.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics3d; 34 | 35 | /** 36 | * A double-sided face. This is identical to a normal face except that during 37 | * rendering these faces will be drawn no matter which side they are viewed 38 | * from. 39 | * 40 | * @since 1.1 41 | */ 42 | public class DoubleSidedFace extends Face { 43 | 44 | /** 45 | * Creates a new double-sided face. 46 | * 47 | * @param owner the object that the face belongs to ({@code null} not 48 | * permitted). 49 | * @param vertices the vertices. 50 | * 51 | * @since 1.3 52 | */ 53 | public DoubleSidedFace(Object3D owner, int[] vertices) { 54 | super(owner, vertices); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/graphics3d/LineObject3D.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics3d; 34 | 35 | import java.awt.Color; 36 | 37 | /** 38 | * A line between two points in 3D space. 39 | * 40 | * @since 1.5 41 | */ 42 | public class LineObject3D extends Object3D { 43 | 44 | /** 45 | * Creates a new {@code Line3D} instance. 46 | * 47 | * @param x0 the x-coordinate for the start of the line. 48 | * @param y0 the y-coordinate for the start of the line. 49 | * @param z0 the z-coordinate for the start of the line. 50 | * @param x1 the x-coordinate for the end of the line. 51 | * @param y1 the y-coordinate for the end of the line. 52 | * @param z1 the z-coordinate for the end of the line. 53 | * @param color the color ({@code null} not permitted). 54 | */ 55 | public LineObject3D(float x0, float y0, float z0, float x1, float y1, float z1, 56 | Color color) { 57 | super(color); 58 | addVertex(x0, y0, z0); 59 | addVertex(x1, y1, z1); 60 | addFace(new Face(this, new int[] {0, 1})); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/graphics3d/internal/FaceSorter.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics3d.internal; 34 | 35 | import java.util.List; 36 | import org.jfree.chart3d.graphics3d.Face; 37 | import org.jfree.chart3d.graphics3d.Point3D; 38 | 39 | /** 40 | * An interface that must be implemented by objects that can sort faces prior 41 | * to rendering (the Painter's algorithm). 42 | * 43 | * @since 1.3 44 | */ 45 | public interface FaceSorter { 46 | 47 | /** 48 | * Returns a list of faces in the order that they should be painted. 49 | * 50 | * @param faces the faces before sorting ({@code null} not permitted). 51 | * @param eyePts the points in 3D space relative to the viewing position. 52 | * 53 | * @return An ordered list (note that the result may be the same list 54 | * passed in via the {@code faces} argument). 55 | */ 56 | List sort(List faces, Point3D[] eyePts); 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/graphics3d/internal/StandardFaceSorter.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics3d.internal; 34 | 35 | import java.io.Serializable; 36 | import java.util.List; 37 | import org.jfree.chart3d.graphics3d.Face; 38 | import org.jfree.chart3d.graphics3d.Point3D; 39 | 40 | /** 41 | * A face sorter that orders the faces by z-value. 42 | * 43 | * @since 1.3 44 | */ 45 | public class StandardFaceSorter implements FaceSorter, Serializable { 46 | 47 | /** 48 | * Creates a new instance. 49 | */ 50 | public StandardFaceSorter() { 51 | // nothing to do 52 | } 53 | 54 | @Override 55 | public List sort(List faces, Point3D[] eyePts) { 56 | faces.sort(new ZOrderComparator(eyePts)); 57 | return faces; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/graphics3d/internal/TaggedFace.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics3d.internal; 34 | 35 | import org.jfree.chart3d.graphics3d.Face; 36 | import org.jfree.chart3d.graphics3d.Object3D; 37 | import org.jfree.chart3d.internal.Args; 38 | 39 | /** 40 | * A face belonging to an {@link Object3D} that has a tag. 41 | * 42 | * @since 1.3 43 | */ 44 | public class TaggedFace extends Face { 45 | 46 | /** The tag. */ 47 | private String tag; 48 | 49 | /** 50 | * Creates a new instance. 51 | * 52 | * @param owner the owner ({@code null} not permitted). 53 | * @param vertices the vertices (must contain at least 3 vertices). 54 | * @param tag the tag ({@code null} not permitted). 55 | */ 56 | public TaggedFace(Object3D owner, int[] vertices, String tag) { 57 | super(owner, vertices); 58 | Args.nullNotPermitted(tag, "tag"); 59 | this.tag = tag; 60 | } 61 | 62 | /** 63 | * Returns the tag that was specified in the constructor. 64 | * 65 | * @return The tag (never {@code null}). 66 | */ 67 | @Override 68 | public String getTag() { 69 | return this.tag; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/graphics3d/internal/ZOrderComparator.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics3d.internal; 34 | 35 | import java.util.Comparator; 36 | import org.jfree.chart3d.graphics3d.Face; 37 | import org.jfree.chart3d.graphics3d.Point3D; 38 | 39 | /** 40 | * A comparator that orders {@link Face} instances by Z-order. 41 | */ 42 | public class ZOrderComparator implements Comparator { 43 | 44 | Point3D[] pts; 45 | 46 | /** 47 | * Creates a new comparator. 48 | * 49 | * @param pts the points. 50 | */ 51 | public ZOrderComparator(Point3D[] pts) { 52 | this.pts = pts; 53 | } 54 | 55 | /* (non-Javadoc) 56 | * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) 57 | */ 58 | @Override 59 | public int compare(Face f1, Face f2) { 60 | double z1 = f1.calculateAverageZValue(this.pts); 61 | double z2 = f2.calculateAverageZValue(this.pts); 62 | return Double.compare(z1, z2); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/graphics3d/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The core 3D graphics rendering engine which is fully implemented using 3 | * the Java2D (Graphics2D) API. This engine is intended to have a general 4 | * purpose function, you should find no chart-specific code in this package. 5 | */ 6 | package org.jfree.chart3d.graphics3d; 7 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/graphics3d/swing/DownAction.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics3d.swing; 34 | 35 | import java.awt.event.ActionEvent; 36 | import javax.swing.AbstractAction; 37 | import javax.swing.Action; 38 | import org.jfree.chart3d.Resources; 39 | import org.jfree.chart3d.internal.Args; 40 | 41 | /** 42 | * An action that handles rotating the 3D view towards the bottom of the screen. 43 | *

44 | * NOTE: This class is serializable, but the serialization format is subject 45 | * to change in future releases and should not be relied upon for persisting 46 | * instances of this class. 47 | */ 48 | @SuppressWarnings("serial") 49 | public class DownAction extends AbstractAction { 50 | 51 | private final Panel3D panel; 52 | 53 | /** 54 | * Creates a new action associated with the specified panel. 55 | * 56 | * @param panel the panel ({@code null} not permitted). 57 | */ 58 | public DownAction(Panel3D panel) { 59 | super("\uF063"); 60 | Args.nullNotPermitted(panel, "panel"); 61 | this.panel = panel; 62 | putValue(Action.SHORT_DESCRIPTION, 63 | Resources.localString("DOWN_ACTION_SHORT_DESCRIPTION")); 64 | } 65 | 66 | @Override 67 | public void actionPerformed(ActionEvent e) { 68 | double delta = this.panel.getRotateIncrement(); 69 | this.panel.getViewPoint().moveUpDown(-delta); 70 | this.panel.repaint(); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/graphics3d/swing/LeftAction.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics3d.swing; 34 | 35 | import java.awt.event.ActionEvent; 36 | 37 | import javax.swing.AbstractAction; 38 | import javax.swing.Action; 39 | 40 | import org.jfree.chart3d.Resources; 41 | import org.jfree.chart3d.internal.Args; 42 | 43 | /** 44 | * An action that handles rotating the 3D view towards the left of the screen. 45 | *

46 | * NOTE: This class is serializable, but the serialization format is subject 47 | * to change in future releases and should not be relied upon for persisting 48 | * instances of this class. 49 | * 50 | * @see RightAction 51 | */ 52 | @SuppressWarnings("serial") 53 | public class LeftAction extends AbstractAction { 54 | 55 | private final Panel3D panel; 56 | 57 | /** 58 | * Creates a new action instance. 59 | * 60 | * @param panel the panel ({@code null} not permitted). 61 | */ 62 | public LeftAction(Panel3D panel) { 63 | super("\uF060"); 64 | Args.nullNotPermitted(panel, "panel"); 65 | this.panel = panel; 66 | putValue(Action.SHORT_DESCRIPTION, 67 | Resources.localString("LEFT_ACTION_SHORT_DESCRIPTION")); 68 | } 69 | 70 | @Override 71 | public void actionPerformed(ActionEvent e) { 72 | this.panel.panLeftRight(this.panel.getPanIncrement()); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/graphics3d/swing/RightAction.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics3d.swing; 34 | 35 | import java.awt.event.ActionEvent; 36 | 37 | import javax.swing.AbstractAction; 38 | import javax.swing.Action; 39 | 40 | import org.jfree.chart3d.Resources; 41 | import org.jfree.chart3d.internal.Args; 42 | 43 | /** 44 | * An action that handles rotating the 3D view towards the right of the screen. 45 | *

46 | * NOTE: This class is serializable, but the serialization format is subject 47 | * to change in future releases and should not be relied upon for persisting 48 | * instances of this class. 49 | * 50 | * @see LeftAction 51 | */ 52 | @SuppressWarnings("serial") 53 | public class RightAction extends AbstractAction { 54 | 55 | private final Panel3D panel; 56 | 57 | /** 58 | * Creates a new action instance. 59 | * 60 | * @param panel the panel ({@code null} not permitted). 61 | */ 62 | public RightAction(Panel3D panel) { 63 | super("\uF061"); 64 | Args.nullNotPermitted(panel, "panel"); 65 | this.panel = panel; 66 | putValue(Action.SHORT_DESCRIPTION, 67 | Resources.localString("RIGHT_ACTION_SHORT_DESCRIPTION")); 68 | } 69 | 70 | @Override 71 | public void actionPerformed(ActionEvent e) { 72 | this.panel.panLeftRight(-this.panel.getPanIncrement()); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/graphics3d/swing/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Components to display 3D graphics in Swing applications. This package 3 | * provides general purpose facilities, you should not find any chart-specific 4 | * code in here. 5 | */ 6 | package org.jfree.chart3d.graphics3d.swing; 7 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/interaction/Chart3DMouseListener.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.interaction; 34 | 35 | import java.util.EventListener; 36 | import org.jfree.chart3d.Chart3DPanel; 37 | 38 | /** 39 | * The interface that must be implemented by classes that wish to receive 40 | * {@link Chart3DMouseEvent} notifications from a {@link Chart3DPanel}. 41 | * 42 | * @see Chart3DPanel#addChartMouseListener(org.jfree.chart3d.interaction.Chart3DMouseListener) 43 | * 44 | * @since 1.3 45 | */ 46 | public interface Chart3DMouseListener extends EventListener { 47 | 48 | /** 49 | * Callback method for receiving notification of a mouse click on a chart. 50 | * 51 | * @param event information about the event. 52 | */ 53 | void chartMouseClicked(Chart3DMouseEvent event); 54 | 55 | /** 56 | * Callback method for receiving notification of a mouse movement on a 57 | * chart. 58 | * 59 | * @param event information about the event. 60 | */ 61 | void chartMouseMoved(Chart3DMouseEvent event); 62 | 63 | } -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/interaction/KeyedValues3DItemSelection.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.interaction; 34 | 35 | import org.jfree.chart3d.data.KeyedValues3D; 36 | import org.jfree.chart3d.data.KeyedValues3DItemKey; 37 | 38 | /** 39 | * An object representing a set of selected items for a {@link KeyedValues3D} 40 | * dataset. 41 | * 42 | * @since 1.3 43 | */ 44 | public interface KeyedValues3DItemSelection { 45 | 46 | /** 47 | * Returns {@code true} if the specified key exists in the selection, 48 | * and {@code false} otherwise. 49 | * 50 | * @param itemKey the item key ({@code null} not permitted). 51 | * 52 | * @return A boolean. 53 | */ 54 | boolean isSelected(KeyedValues3DItemKey itemKey); 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/interaction/XYZDataItemSelection.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.interaction; 34 | 35 | import org.jfree.chart3d.data.xyz.XYZDataset; 36 | import org.jfree.chart3d.data.xyz.XYZItemKey; 37 | 38 | /** 39 | * An object representing a selection of items from an {@link XYZDataset}. 40 | */ 41 | public interface XYZDataItemSelection> { 42 | 43 | /** 44 | * Returns {@code true} if the specified item is present in the 45 | * selection, and {@code false} otherwise. 46 | * 47 | * @param item the item key ({@code null} not permitted). 48 | * 49 | * @return A boolean. 50 | */ 51 | boolean isSelected(XYZItemKey item); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/interaction/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes that support user interaction with charts. 3 | */ 4 | package org.jfree.chart3d.interaction; -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/label/CategoryItemLabelGenerator.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.label; 34 | 35 | import org.jfree.chart3d.data.category.CategoryDataset3D; 36 | 37 | /** 38 | * An item label generator for category charts (this is used for tooltips and 39 | * data item labels). Note that this generator is used for individual data 40 | * items, and is distinct from the {@link CategoryLabelGenerator} which 41 | * generates labels for series keys, column keys and row keys. 42 | * The {@link StandardCategoryItemLabelGenerator} class provides the default 43 | * implementation. 44 | * 45 | * @since 1.3 46 | */ 47 | public interface CategoryItemLabelGenerator { 48 | 49 | /** 50 | * Generates a label for one series in a {@link CategoryDataset3D}. 51 | * 52 | * @param dataset the dataset ({@code null} not permitted). 53 | * @param seriesKey the series key ({@code null} not permitted). 54 | * @param rowKey the row key ({@code null} not permitted). 55 | * @param columnKey the column key ({@code null} not permitted). 56 | * 57 | * @return The series label (possibly {@code null}). 58 | */ 59 | String generateItemLabel(CategoryDataset3D dataset, 60 | Comparable seriesKey, Comparable rowKey, 61 | Comparable columnKey); 62 | 63 | } -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/label/ItemLabelPositioning.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.label; 34 | 35 | /** 36 | * An enumeration of the item label positioning types. 37 | * 38 | * @since 1.3 39 | */ 40 | public enum ItemLabelPositioning { 41 | 42 | /** 43 | * Labels are placed at the front and the back (typically only one of the 44 | * two is visible at any time). 45 | */ 46 | FRONT_AND_BACK, 47 | 48 | /** 49 | * A single label is placed centrally. 50 | */ 51 | CENTRAL 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/label/PieLabelGenerator.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.label; 34 | 35 | import org.jfree.chart3d.data.PieDataset3D; 36 | 37 | /** 38 | * A label generator for pie charts. A default implementation 39 | * ({@link StandardPieLabelGenerator}) is provided. 40 | */ 41 | public interface PieLabelGenerator { 42 | 43 | /** 44 | * Returns a label for one data item in a pie chart. 45 | * 46 | * @param dataset the dataset ({@code null} not permitted). 47 | * @param key the key ({@code null} not permitted). 48 | * 49 | * @return The label (possibly {@code null}). 50 | */ 51 | String generateLabel(PieDataset3D dataset, Comparable key); 52 | 53 | } -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/label/XYZItemLabelGenerator.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.label; 34 | 35 | import org.jfree.chart3d.data.xyz.XYZDataset; 36 | 37 | /** 38 | * A label generator for data items in XYZ charts (this can be used for 39 | * tooltips and item labels). The ({@link StandardXYZItemLabelGenerator}) 40 | * class provides the default implementation. 41 | *

42 | * Implementations of this interface are expected to support cloning and 43 | * serialization. 44 | * 45 | * @since 1.3 46 | */ 47 | public interface XYZItemLabelGenerator { 48 | 49 | /** 50 | * Generates an item label for one data item in an {@link XYZDataset}. 51 | * 52 | * @param dataset the dataset ({@code null} not permitted). 53 | * @param seriesKey the series key ({@code null} not permitted). 54 | * @param itemIndex the item index. 55 | * 56 | * @return The item label (possibly {@code null}). 57 | */ 58 | String generateItemLabel(XYZDataset dataset, Comparable seriesKey, 59 | int itemIndex); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/label/XYZLabelGenerator.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.label; 34 | 35 | import org.jfree.chart3d.data.xyz.XYZDataset; 36 | 37 | /** 38 | * A label generator for XYZ charts, used to create labels for the chart 39 | * legend. The ({@link StandardXYZLabelGenerator}) class provides the default 40 | * implementation. 41 | * 42 | * @since 1.2 43 | */ 44 | public interface XYZLabelGenerator { 45 | 46 | /** 47 | * Generates a label for one series in a {@link XYZDataset}. 48 | * 49 | * @param The type of the series keys in the dataset. 50 | * @param dataset the dataset ({@code null} not permitted). 51 | * @param seriesKey the series key ({@code null} not permitted). 52 | * 53 | * @return The series label (possibly {@code null}). 54 | */ 55 | > String generateSeriesLabel( 56 | XYZDataset dataset, S seriesKey); 57 | 58 | } -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/label/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes related to chart labels. 3 | */ 4 | package org.jfree.chart3d.label; 5 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/legend/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes related to chart legends. 3 | */ 4 | package org.jfree.chart3d.legend; 5 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/marker/CategoryMarkerType.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.marker; 34 | 35 | /** 36 | * An enumeration of the different types of {@link CategoryMarker}. 37 | * 38 | * @since 1.2 39 | */ 40 | public enum CategoryMarkerType { 41 | 42 | /** The marker is represented as a line in the middle of the category. */ 43 | LINE, 44 | 45 | /** The marker is represented as a band covering the category width. */ 46 | BAND 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/marker/MarkerChangeListener.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.marker; 34 | 35 | import java.util.EventListener; 36 | 37 | /** 38 | * A listener for marker change events. 39 | * 40 | * @since 1.2 41 | */ 42 | public interface MarkerChangeListener extends EventListener { 43 | 44 | /** 45 | * Called to inform that an marker change event has occurred. 46 | * 47 | * @param event the event ({@code null} not permitted). 48 | */ 49 | void markerChanged(MarkerChangeEvent event); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/marker/MarkerDataType.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.marker; 34 | 35 | /** 36 | * An enumeration of the different types of {@link MarkerData}. 37 | * 38 | * @since 1.2 39 | */ 40 | public enum MarkerDataType { 41 | 42 | /** A single value. */ 43 | VALUE, 44 | 45 | /** A value range. */ 46 | RANGE 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/marker/ValueMarker.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.marker; 34 | 35 | import org.jfree.chart3d.data.Range; 36 | 37 | /** 38 | * A marker that can be used to mark a value or range of values on a 39 | * {@link org.jfree.chart3d.axis.ValueAxis3D}. 40 | * 41 | * @since 1.2 42 | */ 43 | public interface ValueMarker extends Marker { 44 | 45 | /** 46 | * Returns the range of values covered by the marker. If the marker 47 | * represents a single value rather than a range of values, then the range 48 | * that is returned will have zero length. 49 | * 50 | * @return The range (never {@code null}). 51 | */ 52 | Range getRange(); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/marker/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides value and range marker support for the axes on category and XYZ 3 | * plots. 4 | */ 5 | package org.jfree.chart3d.marker; -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Core classes, including {@link org.jfree.chart3d.Chart3D}, 3 | * {@link org.jfree.chart3d.Chart3DPanel} and 4 | * {@link org.jfree.chart3d.Chart3DFactory}. 5 | */ 6 | package org.jfree.chart3d; 7 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/plot/FontSource.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.plot; 34 | 35 | import java.awt.Font; 36 | 37 | /** 38 | * An object that supplies {@code Font} instances associated with 39 | * keys. This is used by the {@link PiePlot3D} class to obtain section label 40 | * fonts for each data item(segment) in the chart. A default implementation 41 | * ({@link StandardFontSource}) is provided. 42 | */ 43 | public interface FontSource { 44 | 45 | /** 46 | * Returns a font based on the supplied key. 47 | * 48 | * @param key the key ({@code null} not permitted). 49 | * 50 | * @return A font (never {@code null}). 51 | */ 52 | Font getFont(K key); 53 | 54 | /** 55 | * Sets the font associated with a key. 56 | * 57 | * @param key the key ({@code null} not permitted). 58 | * @param font the font ({@code null} not permitted). 59 | */ 60 | void setFont(K key, Font font); 61 | 62 | /** 63 | * Restyles the source using the specified font. Refer to the implementing 64 | * class to confirm the precise behaviour (typically all existing font 65 | * settings are cleared and this font is installed as the new default 66 | * section label font). 67 | * 68 | * @param font the font ({@code null} not permitted). 69 | * 70 | * @since 1.2 71 | */ 72 | void style(Font font); 73 | 74 | } -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/plot/Plot3DChangeListener.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.plot; 34 | 35 | import java.util.EventListener; 36 | import org.jfree.chart3d.Chart3D; 37 | import org.jfree.chart3d.Chart3DChangeEvent; 38 | 39 | /** 40 | * An interface used to receive change events from {@link Plot3D} instances. 41 | * The {@link Chart3D} class will register with its plot to receive change 42 | * notifications - and upon receiving a change notification, it will pass it 43 | * on as a {@link Chart3DChangeEvent}. 44 | */ 45 | public interface Plot3DChangeListener extends EventListener { 46 | 47 | /** 48 | * Receives notification that a plot has changed. 49 | * 50 | * @param event event info. 51 | */ 52 | void plotChanged(Plot3DChangeEvent event); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/plot/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Standard plot types ({@link org.jfree.chart3d.plot.PiePlot3D}, 3 | * {@link org.jfree.chart3d.plot.CategoryPlot3D} and 4 | * {@link org.jfree.chart3d.plot.XYZPlot}) that can be used with the 5 | * {@link org.jfree.chart3d.Chart3D} class. 6 | */ 7 | package org.jfree.chart3d.plot; 8 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/renderer/ColorScale.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.renderer; 34 | 35 | import java.awt.Color; 36 | import org.jfree.chart3d.data.Range; 37 | 38 | /** 39 | * A color scale converts a data value into a color according to some 40 | * predefined color scale. 41 | * 42 | * @since 1.1 43 | */ 44 | public interface ColorScale { 45 | 46 | /** 47 | * Returns the range over which the scale is defined. 48 | * 49 | * @return The range (never {@code null}). 50 | */ 51 | Range getRange(); 52 | 53 | /** 54 | * Returns the color on the scale that corresponds to the specified 55 | * value. 56 | * 57 | * @param value the value. 58 | * 59 | * @return The color (never {@code null}). 60 | */ 61 | Color valueToColor(double value); 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/renderer/ColorScaleRenderer.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.renderer; 34 | 35 | import org.jfree.chart3d.legend.ColorScaleLegendBuilder; 36 | 37 | /** 38 | * An interface that should be implemented by renderers that use a 39 | * {@link ColorScale} - this provides a mechanism for the 40 | * {@link ColorScaleLegendBuilder} to find the color scale. 41 | * 42 | * @since 1.1 43 | */ 44 | public interface ColorScaleRenderer { 45 | 46 | /** 47 | * Returns the color scale used by the renderer. 48 | * 49 | * @return The color scale. 50 | */ 51 | ColorScale getColorScale(); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/renderer/ComposeType.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.renderer; 34 | 35 | import org.jfree.chart3d.renderer.xyz.SurfaceRenderer; 36 | 37 | /** 38 | * An enumeration of the different methods used by renderers for composing the 39 | * items in a chart. Most renderers work on a per-item basis, where the plot 40 | * iterates over the items in a dataset then asks the renderer to compose one 41 | * item at a time. An alternative approach is where the renderer does the 42 | * entire composition in one pass (the {@link SurfaceRenderer} does this, 43 | * since it plots a function rather than a dataset (performing sampling of 44 | * the function on-the-fly). 45 | */ 46 | public enum ComposeType { 47 | 48 | /** Compose each item individually. */ 49 | PER_ITEM, 50 | 51 | /** Compose all items at once. */ 52 | ALL 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/renderer/Renderer3DChangeListener.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.renderer; 34 | 35 | import java.util.EventListener; 36 | import org.jfree.chart3d.plot.CategoryPlot3D; 37 | import org.jfree.chart3d.plot.XYZPlot; 38 | 39 | /** 40 | * An interface through which notification of changes to a {@link Renderer3D} 41 | * can be received. By default, a {@link CategoryPlot3D} or an {@link XYZPlot} 42 | * will register as a listener on the renderer that it is using (if the 43 | * renderer changes, the plot passes on a change event to the chart). 44 | */ 45 | public interface Renderer3DChangeListener extends EventListener { 46 | 47 | /** 48 | * Called to signal a change to a renderer. 49 | * 50 | * @param event information about the change. 51 | */ 52 | void rendererChanged(Renderer3DChangeEvent event); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/renderer/category/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Renderers that can be used with the 3 | * {@link org.jfree.chart3d.plot.CategoryPlot3D} class. 4 | */ 5 | package org.jfree.chart3d.renderer.category; 6 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/renderer/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Base package for renderer support. 3 | */ 4 | package org.jfree.chart3d.renderer; 5 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/renderer/xyz/XYZColorSource.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.renderer.xyz; 34 | 35 | import java.awt.Color; 36 | 37 | /** 38 | * A source of {@code Color} values for an {@link XYZRenderer}. 39 | *

40 | * Classes that implement this interface should also implement 41 | * {@code java.io.Serializable}, otherwise it will not be possible to 42 | * serialize and deserialize charts that use the non-serializable instance. 43 | */ 44 | public interface XYZColorSource { 45 | 46 | /** 47 | * Returns the color for one item in the plot. 48 | * 49 | * @param series the series index. 50 | * @param item the item index. 51 | * 52 | * @return The color (never {@code null}). 53 | */ 54 | Color getColor(int series, int item); 55 | 56 | /** 57 | * Returns the color that represents the specified series. 58 | * 59 | * @param series the series index. 60 | * 61 | * @return The color (never {@code null}). 62 | */ 63 | Color getLegendColor(int series); 64 | 65 | /** 66 | * Restyles the source using the specified colors. Refer to the 67 | * implementing class to confirm the precise behaviour (typically all 68 | * existing color settings are cleared and the specified colors are 69 | * installed as the new defaults). 70 | * 71 | * @param colors the colors. 72 | * 73 | * @since 1.2 74 | */ 75 | void style(Color... colors); 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/renderer/xyz/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Renderers that can be used with the 3 | * {@link org.jfree.chart3d.plot.XYZPlot} class. 4 | */ 5 | package org.jfree.chart3d.renderer.xyz; 6 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/style/ChartStyleChangeEvent.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.style; 34 | 35 | import java.util.EventObject; 36 | 37 | import org.jfree.chart3d.internal.Args; 38 | 39 | /** 40 | * An event that signals a change to a {@link ChartStyle}. 41 | *

42 | * NOTE: This class is serializable, but the serialization format is subject 43 | * to change in future releases and should not be relied upon for persisting 44 | * instances of this class. 45 | * 46 | * @since 1.2 47 | */ 48 | @SuppressWarnings("serial") 49 | public class ChartStyleChangeEvent extends EventObject { 50 | 51 | private ChartStyle style; 52 | 53 | /** 54 | * Creates a new event. 55 | * 56 | * @param style the style ({@code null} not permitted). 57 | */ 58 | public ChartStyleChangeEvent(ChartStyle style) { 59 | this(style, style); 60 | } 61 | 62 | /** 63 | * Creates a new event. 64 | * 65 | * @param source the source. 66 | * @param style the style ({@code null} not permitted). 67 | */ 68 | public ChartStyleChangeEvent(Object source, ChartStyle style) { 69 | super(source); 70 | Args.nullNotPermitted(style, "style"); 71 | this.style = style; 72 | } 73 | 74 | /** 75 | * Returns the chart style that this event is associated with. 76 | * 77 | * @return The style (never {@code null}). 78 | */ 79 | public ChartStyle getChartStyle () { 80 | return this.style; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/style/ChartStyleChangeListener.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.style; 34 | 35 | import java.util.EventListener; 36 | import org.jfree.chart3d.Chart3D; 37 | 38 | /** 39 | * An interface for receiving notification of changes to a {@link ChartStyle} 40 | * instance. 41 | *

42 | * The {@link Chart3D} class implements this interface so that it can 43 | * receive notification of changes to the chart style. 44 | * 45 | * @since 1.2 46 | */ 47 | public interface ChartStyleChangeListener extends EventListener { 48 | 49 | /** 50 | * Called to inform that a chart change event has occurred. 51 | * 52 | * @param event the event. 53 | */ 54 | void styleChanged(ChartStyleChangeEvent event); 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/style/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes for controlling chart styles. 3 | */ 4 | package org.jfree.chart3d.style; 5 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/table/ContainerElement.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.table; 34 | 35 | /** 36 | * A {@link TableElement} that contains other elements (provides the 37 | * {@code addElement()} method). 38 | * 39 | * @since 1.1 40 | */ 41 | public interface ContainerElement extends TableElement { 42 | 43 | /** 44 | * Adds a sub-element to the container element. 45 | * 46 | * @param element the element ({@code null} not permitted). 47 | */ 48 | void addElement(TableElement element); 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/table/ElementInfo.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.table; 34 | 35 | import java.awt.geom.Dimension2D; 36 | import org.jfree.chart3d.internal.Args; 37 | 38 | /** 39 | * An object that pairs an element with its dimension for one specific 40 | * graphics target. 41 | * 42 | * @since 1.1 43 | */ 44 | public class ElementInfo { 45 | 46 | /** The element. */ 47 | private TableElement element; 48 | 49 | /** The element's size. */ 50 | private Dimension2D dimension; 51 | 52 | /** 53 | * Creates a new instance. 54 | * 55 | * @param element the element ({@code null} not permitted). 56 | * @param dimension the dimension ({@code null} not permitted). 57 | */ 58 | public ElementInfo(TableElement element, Dimension2D dimension) { 59 | Args.nullNotPermitted(element, "element"); 60 | Args.nullNotPermitted(dimension, "dimension"); 61 | this.element = element; 62 | this.dimension = dimension; 63 | } 64 | 65 | /** 66 | * Returns the element. 67 | * 68 | * @return The element (never {@code null}). 69 | */ 70 | public TableElement getElement() { 71 | return this.element; 72 | } 73 | 74 | /** 75 | * Returns the element's size. 76 | * 77 | * @return The element's size (never {@code null}). 78 | */ 79 | public Dimension2D getDimension() { 80 | return this.dimension; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/table/HAlign.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.table; 34 | 35 | /** 36 | * Horizontal alignment options. 37 | */ 38 | public enum HAlign { 39 | 40 | /** Left alignment. */ 41 | LEFT, 42 | 43 | /** Center alignment. */ 44 | CENTER, 45 | 46 | /** Right alignment. */ 47 | RIGHT 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/table/RectanglePainter.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.table; 34 | 35 | import java.awt.Graphics2D; 36 | import java.awt.geom.Rectangle2D; 37 | import org.jfree.chart3d.Chart3D; 38 | 39 | /** 40 | * An object that can paint a rectangular region with a color, gradient, image 41 | * or anything. 42 | *

43 | * NOTE: It is recommended that classes that implement this interface are 44 | * designed to be {@code Serializable} and immutable. Immutability is 45 | * desirable because painters are assigned to {@link Chart3D} instances, and 46 | * there is no change notification if the painter can be modified directly. 47 | * In addition, a single painter can be shared amongst multiple charts. 48 | */ 49 | public interface RectanglePainter { 50 | 51 | /** 52 | * Fills the specified rectangle (where "fill" is some arbitrary drawing 53 | * operation defined by the class that implements this interface). 54 | * 55 | * @param g2 the graphics target ({@code null} not permitted). 56 | * @param bounds the rectangle ({@code null} not permitted). 57 | */ 58 | void fill(Graphics2D g2, Rectangle2D bounds); 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/table/TableElementOnDraw.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.table; 34 | 35 | import java.awt.Graphics2D; 36 | import java.awt.geom.Rectangle2D; 37 | 38 | /** 39 | * An interface that provides access to the {@link TableElement} rendering 40 | * process. 41 | * 42 | * @since 1.3 43 | */ 44 | public interface TableElementOnDraw { 45 | 46 | /** 47 | * A callback method that is called before an element is drawn. 48 | * 49 | * @param element the element ({@code null} not permitted). 50 | * @param g2 the graphics target ({@code null} not permitted). 51 | * @param bounds the bounds ({@code null} not permitted). 52 | */ 53 | void beforeDraw(TableElement element, Graphics2D g2, Rectangle2D bounds); 54 | 55 | /** 56 | * A callback method that is called after an element is drawn. 57 | * 58 | * @param element the element ({@code null} not permitted). 59 | * @param g2 the graphics target ({@code null} not permitted). 60 | * @param bounds the bounds ({@code null} not permitted). 61 | */ 62 | void afterDraw(TableElement element, Graphics2D g2, Rectangle2D bounds); 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/table/TableElementVisitor.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.table; 34 | 35 | /** 36 | * A table element visitor. This is a general purpose mechanism to traverse 37 | * a hierarchy of table elements. 38 | * 39 | * @since 1.2 40 | */ 41 | public interface TableElementVisitor { 42 | 43 | /** 44 | * Performs the visitor's operation on the table element. 45 | * 46 | * @param element the element ({@code null} not permitted). 47 | */ 48 | void visit(TableElement element); 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/table/VAlign.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.table; 34 | 35 | /** 36 | * Vertical alignment options. 37 | */ 38 | public enum VAlign { 39 | 40 | /** Top. */ 41 | TOP, 42 | 43 | /** Middle. */ 44 | MIDDLE, 45 | 46 | /** Bottom. */ 47 | BOTTOM 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/table/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Classes and interfaces for constructing tables for display to the user. 3 | * This is used for chart legend construction, but the API is intended to be 4 | * general purpose and should not contain any chart-specific code. 5 | */ 6 | package org.jfree.chart3d.table; 7 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/util/json/JSONAware.java: -------------------------------------------------------------------------------- 1 | /* ============ 2 | * Orson Charts 3 | * ============ 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * JSON.simple 10 | * ----------- 11 | * The code in this file originates from the JSON.simple project by 12 | * FangYidong: 13 | * 14 | * https://code.google.com/p/json-simple/ 15 | * 16 | * which is licensed under the Apache Software License version 2.0. 17 | * 18 | * It has been modified locally and repackaged under 19 | * org.jfree.chart3d.util.json.* to avoid conflicts with any other version that 20 | * may be present on the classpath. 21 | * 22 | */ 23 | 24 | package org.jfree.chart3d.util.json; 25 | 26 | /** 27 | * Classes that support customized output of JSON text shall implement this 28 | * interface. 29 | *

30 | * This class is for internal use by Orson Charts, it is not 31 | * part of the supported API and you should not call it directly. If you need 32 | * JSON support in your project you should include JSON.simple 33 | * (https://code.google.com/p/json-simple/) or some other JSON library directly 34 | * in your project. 35 | */ 36 | public interface JSONAware { 37 | 38 | /** 39 | * Returns a JSON string representing the object. 40 | * 41 | * @return A JSON string. 42 | */ 43 | String toJSONString(); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/util/json/JSONStreamAware.java: -------------------------------------------------------------------------------- 1 | /* ============ 2 | * Orson Charts 3 | * ============ 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * JSON.simple 10 | * ----------- 11 | * The code in this file originates from the JSON.simple project by 12 | * FangYidong: 13 | * 14 | * https://code.google.com/p/json-simple/ 15 | * 16 | * which is licensed under the Apache Software License version 2.0. 17 | * 18 | * It has been modified locally and repackaged under 19 | * org.jfree.chart3d.util.json.* to avoid conflicts with any other version that 20 | * may be present on the classpath. 21 | * 22 | */ 23 | 24 | package org.jfree.chart3d.util.json; 25 | 26 | import java.io.IOException; 27 | import java.io.Writer; 28 | 29 | /** 30 | * Beans that support customized output of JSON text to a writer shall implement this interface. 31 | * @author FangYidong<fangyidong@yahoo.com.cn> 32 | */ 33 | public interface JSONStreamAware { 34 | 35 | /** 36 | * write JSON string to out. 37 | * 38 | * @param out the output writer. 39 | * 40 | * @throws IOException if there is an I/O problem. 41 | */ 42 | void writeJSONString(Writer out) throws IOException; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/util/json/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * A local copy of the JSON.simple project by 3 | * FangYidong<fangyidong@yahoo.com.cn>: https://code.google.com/p/json-simple/. 4 | * This package is for internal use by Orson Charts, it is not 5 | * part of the supported API and you should not use it directly. If you need 6 | * JSON support in your project you should include JSON.simple 7 | * (https://code.google.com/p/json-simple/) or some other JSON library directly 8 | * in your project. 9 | */ 10 | package org.jfree.chart3d.util.json; -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/util/json/parser/ContainerFactory.java: -------------------------------------------------------------------------------- 1 | /* ============ 2 | * Orson Charts 3 | * ============ 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * JSON.simple 10 | * ----------- 11 | * The code in this file originates from the JSON.simple project by 12 | * FangYidong: 13 | * 14 | * https://code.google.com/p/json-simple/ 15 | * 16 | * which is licensed under the Apache Software License version 2.0. 17 | * 18 | * It has been modified locally and repackaged under 19 | * org.jfree.chart3d.util.json.* to avoid conflicts with any other version that 20 | * may be present on the classpath. 21 | * 22 | */ 23 | 24 | package org.jfree.chart3d.util.json.parser; 25 | 26 | import java.util.List; 27 | import java.util.Map; 28 | 29 | /** 30 | * Container factory for creating containers for JSON object and JSON array. 31 | * 32 | * @see org.jfree.chart3d.util.json.parser.JSONParser#parse(java.io.Reader, 33 | * ContainerFactory) 34 | */ 35 | public interface ContainerFactory { 36 | 37 | /** 38 | * @return A Map instance to store JSON object, or null if you want to use 39 | * org.jfree.chart3d.util.json.JSONObject. 40 | */ 41 | Map createObjectContainer(); 42 | 43 | /** 44 | * @return A List instance to store JSON array, or null if you want to use 45 | * org.jfree.chart3d.util.json.JSONArray. 46 | */ 47 | List creatArrayContainer(); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/util/json/parser/Yytoken.java: -------------------------------------------------------------------------------- 1 | /* ============ 2 | * Orson Charts 3 | * ============ 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * JSON.simple 10 | * ----------- 11 | * The code in this file originates from the JSON.simple project by 12 | * FangYidong: 13 | * 14 | * https://code.google.com/p/json-simple/ 15 | * 16 | * which is licensed under the Apache Software License version 2.0. 17 | * 18 | * It has been modified locally and repackaged under 19 | * org.jfree.chart3d.util.json.* to avoid conflicts with any other version that 20 | * may be present on the classpath. 21 | * 22 | */ 23 | 24 | package org.jfree.chart3d.util.json.parser; 25 | 26 | /** 27 | * 28 | */ 29 | public class Yytoken { 30 | public static final int TYPE_VALUE = 0;//JSON primitive value: string,number,boolean,null 31 | public static final int TYPE_LEFT_BRACE = 1; 32 | public static final int TYPE_RIGHT_BRACE = 2; 33 | public static final int TYPE_LEFT_SQUARE = 3; 34 | public static final int TYPE_RIGHT_SQUARE = 4; 35 | public static final int TYPE_COMMA = 5; 36 | public static final int TYPE_COLON = 6; 37 | public static final int TYPE_EOF = -1;//end of file 38 | 39 | public int type = 0; 40 | public Object value = null; 41 | 42 | public Yytoken(int type,Object value){ 43 | this.type=type; 44 | this.value=value; 45 | } 46 | 47 | @Override 48 | public String toString(){ 49 | StringBuilder sb = new StringBuilder(); 50 | switch (type) { 51 | case TYPE_VALUE: 52 | sb.append("VALUE(").append(value).append(")"); 53 | break; 54 | case TYPE_LEFT_BRACE: 55 | sb.append("LEFT BRACE({)"); 56 | break; 57 | case TYPE_RIGHT_BRACE: 58 | sb.append("RIGHT BRACE(})"); 59 | break; 60 | case TYPE_LEFT_SQUARE: 61 | sb.append("LEFT SQUARE([)"); 62 | break; 63 | case TYPE_RIGHT_SQUARE: 64 | sb.append("RIGHT SQUARE(])"); 65 | break; 66 | case TYPE_COMMA: 67 | sb.append("COMMA(,)"); 68 | break; 69 | case TYPE_COLON: 70 | sb.append("COLON(:)"); 71 | break; 72 | case TYPE_EOF: 73 | sb.append("END OF FILE"); 74 | break; 75 | } 76 | return sb.toString(); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/org/jfree/chart3d/util/json/parser/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * A local copy of the JSON.simple project by 3 | * FangYidong<fangyidong@yahoo.com.cn>: https://code.google.com/p/json-simple/. 4 | * This package is for internal use by Orson Charts, it is not 5 | * part of the supported API and you should not use it directly. If you need 6 | * JSON support in your project you should include JSON.simple 7 | * (https://code.google.com/p/json-simple/) or some other JSON library directly 8 | * in your project. 9 | */ 10 | package org.jfree.chart3d.util.json.parser; -------------------------------------------------------------------------------- /src/main/resources/org/jfree/chart3d/Resources.properties: -------------------------------------------------------------------------------- 1 | # Resources for localisation. These strings are referenced in the source 2 | # code by key only, and can be localised by creating locale-specific properties 3 | # files 4 | 5 | # Popup menu items 6 | ZOOM_IN = Zoom In 7 | ZOOM_OUT = Zoom Out 8 | ZOOM_TO_FIT = Zoom To Fit 9 | EXPORT_AS = Export As 10 | JPG_MENU_LABEL = JPEG... 11 | PDF_MENU_LABEL = PDF... 12 | PNG_MENU_LABEL = PNG... 13 | SVG_MENU_LABEL = SVG... 14 | 15 | # Toolbar action tooltips 16 | UP_ACTION_SHORT_DESCRIPTION = Rotate up 17 | DOWN_ACTION_SHORT_DESCRIPTION = Rotate down 18 | LEFT_ACTION_SHORT_DESCRIPTION = Rotate to the left 19 | RIGHT_ACTION_SHORT_DESCRIPTION = Rotate to the right 20 | ROLL_LEFT_ACTION_SHORT_DESCRIPTION = Roll counter-clockwise 21 | ROLL_RIGHT_ACTION_SHORT_DESCRIPTION = Roll clockwise 22 | 23 | # File filter items 24 | JPG_FILE_FILTER_DESCRIPTION = JPG Files 25 | PDF_FILE_FILTER_DESCRIPTION = Portable Document Format (PDF) 26 | PNG_FILE_FILTER_DESCRIPTION = PNG Files 27 | SVG_FILE_FILTER_DESCRIPTION = Scalable Vector Graphics (SVG) 28 | -------------------------------------------------------------------------------- /src/main/resources/org/jfree/chart3d/Resources_de.properties: -------------------------------------------------------------------------------- 1 | # Resources for localisation. These strings are referenced in the source 2 | # code by key only, and can be localised by creating locale-specific properties 3 | # files 4 | 5 | # German translation provided by Roman Kennke 6 | 7 | # Popup menu items 8 | ZOOM_IN = Vergr\u00f6\u00dfern 9 | ZOOM_OUT = Verkleinern 10 | ZOOM_TO_FIT = Einpassen 11 | EXPORT_AS = Exportieren als 12 | JPG_MENU_LABEL = JPEG... 13 | PDF_MENU_LABEL = PDF... 14 | PNG_MENU_LABEL = PNG... 15 | SVG_MENU_LABEL = SVG... 16 | 17 | # Toolbar action tooltips 18 | UP_ACTION_SHORT_DESCRIPTION = Nach oben rotieren 19 | DOWN_ACTION_SHORT_DESCRIPTION = Nach unten rotieren 20 | LEFT_ACTION_SHORT_DESCRIPTION = Nach links rotieren 21 | RIGHT_ACTION_SHORT_DESCRIPTION = Nach rechts rotieren 22 | ROLL_LEFT_ACTION_SHORT_DESCRIPTION = Gegen Urzeigersinn rollen 23 | ROLL_RIGHT_ACTION_SHORT_DESCRIPTION = Im Urzeigersinn rollen 24 | 25 | # File filter items 26 | JPG_FILE_FILTER_DESCRIPTION = JPG Dateien 27 | PDF_FILE_FILTER_DESCRIPTION = Portable Document Format (PDF) 28 | PNG_FILE_FILTER_DESCRIPTION = PNG Dateien 29 | SVG_FILE_FILTER_DESCRIPTION = Scalable Vector Graphics (SVG) -------------------------------------------------------------------------------- /src/main/resources/org/jfree/chart3d/Resources_it.properties: -------------------------------------------------------------------------------- 1 | # Resources for localisation. These strings are referenced in the source 2 | # code by key only, and can be localised by creating locale-specific properties 3 | # files 4 | 5 | # Italian translation provided by Mario Torre 6 | 7 | # Popup menu items 8 | ZOOM_IN = Ingrandisci 9 | ZOOM_OUT = Riduci 10 | ZOOM_TO_FIT = Adatta 11 | EXPORT_AS = Esporta Come 12 | JPG_MENU_LABEL = JPEG... 13 | PDF_MENU_LABEL = PDF... 14 | PNG_MENU_LABEL = PNG... 15 | SVG_MENU_LABEL = SVG... 16 | 17 | # Toolbar action tooltips 18 | UP_ACTION_SHORT_DESCRIPTION = Ruota in su 19 | DOWN_ACTION_SHORT_DESCRIPTION = Ruota in gi\u00f9 20 | LEFT_ACTION_SHORT_DESCRIPTION = Gira a sinistra 21 | RIGHT_ACTION_SHORT_DESCRIPTION = Gira a destra 22 | ROLL_LEFT_ACTION_SHORT_DESCRIPTION = Ruota in senso antiorario 23 | ROLL_RIGHT_ACTION_SHORT_DESCRIPTION = Ruota in senso orario 24 | 25 | # File filter items 26 | JPG_FILE_FILTER_DESCRIPTION = JPG Files 27 | PDF_FILE_FILTER_DESCRIPTION = Portable Document Format (PDF) 28 | PNG_FILE_FILTER_DESCRIPTION = PNG Files 29 | SVG_FILE_FILTER_DESCRIPTION = Scalable Vector Graphics (SVG) -------------------------------------------------------------------------------- /src/main/resources/org/jfree/chart3d/graphics3d/swing/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jfree/orson-charts/0a58c8425d2aa18f7ed83b63865c97a75a5eda4e/src/main/resources/org/jfree/chart3d/graphics3d/swing/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/data/DataValuesTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertNull; 36 | import static org.junit.jupiter.api.Assertions.assertEquals; 37 | 38 | import org.junit.jupiter.api.Test; 39 | 40 | /** 41 | * Some checks for the {@link DataUtilities} class. 42 | */ 43 | public class DataValuesTest { 44 | 45 | @Test 46 | public void testFindValueRange() { 47 | DefaultKeyedValues3D data 48 | = new DefaultKeyedValues3D<>(); 49 | assertNull(DataUtils.findValueRange(data)); 50 | data.setValue(1.5, "S1", "R1", "C1"); 51 | assertEquals(new Range(1.5, 1.5), DataUtils.findValueRange(data)); 52 | data.setValue(-1.5, "S2", "R1", "C1"); 53 | assertEquals(new Range(-1.5, 1.5), DataUtils.findValueRange(data)); 54 | } 55 | 56 | @Test 57 | public void testFindValueRangeWithBase() { 58 | DefaultKeyedValues3D data 59 | = new DefaultKeyedValues3D<>(); 60 | assertNull(DataUtils.findValueRange(data)); 61 | data.setValue(1.5, "S1", "R1", "C1"); 62 | assertEquals(new Range(1.0, 1.5), DataUtils.findValueRange(data, 63 | 1.0)); 64 | data.setValue(-1.5, "S2", "R1", "C1"); 65 | assertEquals(new Range(-1.5, 1.5), DataUtils.findValueRange(data, 66 | 1.0)); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/data/KeyedValuesItemKeyTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertFalse; 36 | import static org.junit.jupiter.api.Assertions.assertTrue; 37 | import org.junit.jupiter.api.Test; 38 | import org.jfree.chart3d.TestUtils; 39 | 40 | /** 41 | * Tests for the {@link KeyedValuesItemKey} class. 42 | */ 43 | public class KeyedValuesItemKeyTest { 44 | 45 | @Test 46 | public void testEquals() { 47 | KeyedValuesItemKey k1 = new KeyedValuesItemKey("A"); 48 | KeyedValuesItemKey k2 = new KeyedValuesItemKey("A"); 49 | assertTrue(k1.equals(k2)); 50 | assertFalse(k1.equals(null)); 51 | 52 | k1 = new KeyedValuesItemKey("AA"); 53 | assertFalse(k1.equals(k2)); 54 | k2 = new KeyedValuesItemKey("AA"); 55 | assertTrue(k1.equals(k2)); 56 | } 57 | 58 | @Test 59 | public void testSerialization() { 60 | KeyedValuesItemKey k1 = new KeyedValuesItemKey("A"); 61 | KeyedValuesItemKey k2 = (KeyedValuesItemKey) 62 | TestUtils.serialized(k1); 63 | assertTrue(k1.equals(k2)); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/data/xyz/XYZItemKeyTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.data.xyz; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertEquals; 36 | import static org.junit.jupiter.api.Assertions.assertFalse; 37 | import static org.junit.jupiter.api.Assertions.assertTrue; 38 | import org.junit.jupiter.api.Test; 39 | import org.jfree.chart3d.TestUtils; 40 | 41 | /** 42 | * Tests for the {@link XYZItemKey} class. 43 | */ 44 | public class XYZItemKeyTest { 45 | 46 | @Test 47 | public void testEquals() { 48 | XYZItemKey k1 = new XYZItemKey<>("S1", 1); 49 | XYZItemKey k2 = new XYZItemKey<>("S1", 1); 50 | assertTrue(k1.equals(k2)); 51 | assertFalse(k1.equals(null)); 52 | 53 | k1 = new XYZItemKey<>("S2", 1); 54 | assertFalse(k1.equals(k2)); 55 | k2 = new XYZItemKey<>("S2", 1); 56 | assertTrue(k1.equals(k2)); 57 | 58 | k1 = new XYZItemKey<>("S2", 2); 59 | assertFalse(k1.equals(k2)); 60 | k2 = new XYZItemKey<>("S2", 2); 61 | assertTrue(k1.equals(k2)); 62 | } 63 | 64 | /** 65 | * Check for serialization support. 66 | */ 67 | @Test 68 | @SuppressWarnings("unchecked") 69 | public void testSerialization() { 70 | XYZItemKey k1 = new XYZItemKey<>("S1", 1); 71 | XYZItemKey k2 = (XYZItemKey) TestUtils.serialized(k1); 72 | assertEquals(k1, k2); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/graphics2d/Offset2DTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics2d; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertEquals; 36 | import static org.junit.jupiter.api.Assertions.assertTrue; 37 | import static org.junit.jupiter.api.Assertions.assertFalse; 38 | 39 | import org.junit.jupiter.api.Test; 40 | import org.jfree.chart3d.TestUtils; 41 | import org.jfree.chart3d.graphics3d.Offset2D; 42 | 43 | /** 44 | * Some checks for the {@link Offset2D} class. 45 | */ 46 | public class Offset2DTest { 47 | 48 | @Test 49 | public void testEquals() { 50 | Offset2D off1 = new Offset2D(1.0, 2.0); 51 | Offset2D off2 = new Offset2D(1.0, 2.0); 52 | assertTrue(off1.equals(off2)); 53 | assertFalse(off1.equals(null)); 54 | 55 | off1 = new Offset2D(3.0, 2.0); 56 | assertFalse(off1.equals(off2)); 57 | off2 = new Offset2D(3.0, 2.0); 58 | assertTrue(off1.equals(off2)); 59 | 60 | off1 = new Offset2D(3.0, 4.0); 61 | assertFalse(off1.equals(off2)); 62 | off2 = new Offset2D(3.0, 4.0); 63 | assertTrue(off1.equals(off2)); 64 | } 65 | 66 | @Test 67 | public void testSerialization() { 68 | Offset2D off1 = new Offset2D(1.0, 2.0); 69 | Offset2D off2 = (Offset2D) TestUtils.serialized(off1); 70 | assertEquals(off1, off2); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/graphics3d/Dimension3DTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics3d; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertEquals; 36 | import static org.junit.jupiter.api.Assertions.assertNotEquals; 37 | import org.junit.jupiter.api.Test; 38 | import org.jfree.chart3d.TestUtils; 39 | 40 | /** 41 | * Tests for the {@link Dimension3D} class. 42 | */ 43 | public class Dimension3DTest { 44 | 45 | @Test 46 | public void checkEquals() { 47 | Dimension3D dim1 = new Dimension3D(1, 2, 3); 48 | Dimension3D dim2 = new Dimension3D(1, 2, 3); 49 | assertEquals(dim1, dim2); 50 | 51 | dim1 = new Dimension3D(2, 2, 3); 52 | assertNotEquals(dim1, dim2); 53 | dim2 = new Dimension3D(2, 2, 3); 54 | assertEquals(dim1, dim2); 55 | 56 | dim1 = new Dimension3D(2, 1, 3); 57 | assertNotEquals(dim1, dim2); 58 | dim2 = new Dimension3D(2, 1, 3); 59 | assertEquals(dim1, dim2); 60 | 61 | dim1 = new Dimension3D(2, 1, 4); 62 | assertNotEquals(dim1, dim2); 63 | dim2 = new Dimension3D(2, 1, 4); 64 | assertEquals(dim1, dim2); 65 | } 66 | 67 | /** 68 | * A check for serialization. 69 | */ 70 | @Test 71 | public void testSerialization() { 72 | Dimension3D dim1 = new Dimension3D(1, 2, 3); 73 | Dimension3D dim2 = (Dimension3D) TestUtils.serialized(dim1); 74 | assertEquals(dim1, dim2); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/graphics3d/Point3DTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics3d; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertEquals; 36 | import static org.junit.jupiter.api.Assertions.assertFalse; 37 | import static org.junit.jupiter.api.Assertions.assertTrue; 38 | import org.junit.jupiter.api.Test; 39 | import org.jfree.chart3d.TestUtils; 40 | 41 | /** 42 | * Tests for the {link Point3D} class. 43 | */ 44 | public class Point3DTest { 45 | 46 | @Test 47 | public void testEquals() { 48 | Point3D p1 = new Point3D(1.0, 0.0, 0.0); 49 | Point3D p2 = new Point3D(1.0, 0.0, 0.0); 50 | assertTrue(p1.equals(p2)); 51 | 52 | p1 = new Point3D(1.1, 0.0, 0.0); 53 | assertFalse(p1.equals(p2)); 54 | p2 = new Point3D(1.1, 0.0, 0.0); 55 | assertTrue(p1.equals(p2)); 56 | 57 | p1 = new Point3D(1.1, 2.2, 0.0); 58 | assertFalse(p1.equals(p2)); 59 | p2 = new Point3D(1.1, 2.2, 0.0); 60 | assertTrue(p1.equals(p2)); 61 | 62 | p1 = new Point3D(1.1, 2.2, 3.3); 63 | assertFalse(p1.equals(p2)); 64 | p2 = new Point3D(1.1, 2.2, 3.3); 65 | assertTrue(p1.equals(p2)); 66 | } 67 | 68 | /** 69 | * A check for serialization. 70 | */ 71 | @Test 72 | public void testSerialization() { 73 | Point3D p1 = new Point3D(1.0, 2.0, 3.0); 74 | Point3D p2 = (Point3D) TestUtils.serialized(p1); 75 | assertEquals(p1, p2); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/graphics3d/Rotate3DTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics3d; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertEquals; 36 | import org.junit.jupiter.api.Test; 37 | 38 | /** 39 | * 40 | * @author dgilbert 41 | */ 42 | public class Rotate3DTest { 43 | 44 | private static final double EPSILON = 0.0000001; 45 | 46 | @Test 47 | public void testGeneral() { 48 | Rotate3D r = new Rotate3D(Point3D.ORIGIN, Point3D.UNIT_X, Math.PI); 49 | Point3D p = r.applyRotation(1, 1, 1); 50 | assertEquals(1, p.x, EPSILON); 51 | assertEquals(-1, p.y, EPSILON); 52 | assertEquals(-1, p.z, EPSILON); 53 | } 54 | 55 | @Test 56 | public void test2() { 57 | ViewPoint3D v1 = new ViewPoint3D(-1.675516f, -2.6179938f, 25.874374f, 0); 58 | Rotate3D r = new Rotate3D(Point3D.ORIGIN, v1.getHorizontalRotationAxis(), -Math.PI / 60); 59 | Point3D p = r.applyRotation(v1.getPoint()); 60 | ViewPoint3D v2 = new ViewPoint3D(p, 0); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/graphics3d/internal/Utils3DTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.graphics3d.internal; 34 | 35 | import org.jfree.chart3d.graphics3d.Point3D; 36 | import static org.junit.jupiter.api.Assertions.assertEquals; 37 | import org.junit.jupiter.api.Test; 38 | 39 | /** 40 | * Some tests for the methods in {@link Utils3D}. 41 | */ 42 | public class Utils3DTest { 43 | 44 | private static final double EPSILON = 0.00000001; 45 | 46 | @Test 47 | public void testLength() { 48 | assertEquals(1, Utils3D.length(Point3D.UNIT_X), EPSILON); 49 | assertEquals(1, Utils3D.length(Point3D.UNIT_Y), EPSILON); 50 | assertEquals(1, Utils3D.length(Point3D.UNIT_Z), EPSILON); 51 | assertEquals(0, Utils3D.length(Point3D.ORIGIN), EPSILON); 52 | } 53 | 54 | @Test 55 | public void testAngle() { 56 | assertEquals(Math.PI / 2, Utils3D.angle(Point3D.UNIT_X, Point3D.UNIT_Y), 57 | EPSILON); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/interaction/StandardKeyedValues3DItemSelectionTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.interaction; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertFalse; 36 | import static org.junit.jupiter.api.Assertions.assertTrue; 37 | 38 | import org.junit.jupiter.api.Test; 39 | 40 | import org.jfree.chart3d.TestUtils; 41 | 42 | /** 43 | * Tests for the {@link StandardKeyedValues3DItemSelection} class. 44 | */ 45 | public class StandardKeyedValues3DItemSelectionTest { 46 | 47 | /** 48 | * Some checks for the equals() method. 49 | */ 50 | @Test 51 | public void testEquals() { 52 | StandardKeyedValues3DItemSelection s1 53 | = new StandardKeyedValues3DItemSelection(); 54 | StandardKeyedValues3DItemSelection s2 55 | = new StandardKeyedValues3DItemSelection(); 56 | assertTrue(s1.equals(s2)); 57 | assertFalse(s1.equals(null)); 58 | } 59 | 60 | /** 61 | * Checks for serialization support. 62 | */ 63 | @Test 64 | public void testSerialization() { 65 | StandardKeyedValues3DItemSelection s1 66 | = new StandardKeyedValues3DItemSelection(); 67 | StandardKeyedValues3DItemSelection s2 68 | = (StandardKeyedValues3DItemSelection) TestUtils.serialized(s1); 69 | assertTrue(s1.equals(s2)); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/label/StandardPieLabelGeneratorTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.label; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertFalse; 36 | import static org.junit.jupiter.api.Assertions.assertTrue; 37 | 38 | import org.junit.jupiter.api.Test; 39 | 40 | import org.jfree.chart3d.TestUtils; 41 | 42 | /** 43 | * Tests for the {@link StandardPieLabelGenerator} class. 44 | */ 45 | public class StandardPieLabelGeneratorTest { 46 | 47 | /** 48 | * Some checks for the equals() method. 49 | */ 50 | @Test 51 | public void testEquals() { 52 | StandardPieLabelGenerator lg1 = new StandardPieLabelGenerator(); 53 | StandardPieLabelGenerator lg2 = new StandardPieLabelGenerator(); 54 | assertTrue(lg1.equals(lg2)); 55 | assertFalse(lg1.equals(null)); 56 | 57 | lg1 = new StandardPieLabelGenerator("%s"); 58 | assertFalse(lg1.equals(lg2)); 59 | lg2 = new StandardPieLabelGenerator("%s"); 60 | assertTrue(lg1.equals(lg2)); 61 | } 62 | 63 | /** 64 | * Checks for serialization support. 65 | */ 66 | @Test 67 | public void testSerialization() { 68 | StandardPieLabelGenerator lg1 = new StandardPieLabelGenerator(); 69 | StandardPieLabelGenerator lg2 = new StandardPieLabelGenerator(); 70 | TestUtils.serialized(lg1); 71 | assertTrue(lg1.equals(lg2)); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/label/StandardXYZLabelGeneratorTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.label; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertFalse; 36 | import static org.junit.jupiter.api.Assertions.assertTrue; 37 | 38 | import org.junit.jupiter.api.Test; 39 | 40 | import org.jfree.chart3d.TestUtils; 41 | 42 | /** 43 | * Tests for the {@link StandardXYZLabelGenerator} class. 44 | */ 45 | public class StandardXYZLabelGeneratorTest { 46 | 47 | /** 48 | * Some checks for the equals() method. 49 | */ 50 | @Test 51 | public void testEquals() { 52 | StandardXYZLabelGenerator lg1 = new StandardXYZLabelGenerator(); 53 | StandardXYZLabelGenerator lg2 = new StandardXYZLabelGenerator(); 54 | assertTrue(lg1.equals(lg2)); 55 | assertFalse(lg1.equals(null)); 56 | 57 | lg1 = new StandardXYZLabelGenerator("%s TEST"); 58 | assertFalse(lg1.equals(lg2)); 59 | lg2 = new StandardXYZLabelGenerator("%s TEST"); 60 | assertTrue(lg1.equals(lg2)); 61 | } 62 | 63 | /** 64 | * Checks for serialization support. 65 | */ 66 | @Test 67 | public void testSerialization() { 68 | StandardXYZLabelGenerator lg1 = new StandardXYZLabelGenerator(); 69 | StandardXYZLabelGenerator lg2 = new StandardXYZLabelGenerator(); 70 | TestUtils.serialized(lg1); 71 | assertTrue(lg1.equals(lg2)); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/marker/NumberMarkerTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.marker; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertFalse; 36 | import static org.junit.jupiter.api.Assertions.assertTrue; 37 | 38 | import org.junit.jupiter.api.Test; 39 | 40 | import org.jfree.chart3d.TestUtils; 41 | 42 | /** 43 | * Tests for the {@link NumberMarker} class. 44 | */ 45 | public class NumberMarkerTest { 46 | 47 | /** 48 | * Some checks for the equals() method. 49 | */ 50 | @Test 51 | public void testEquals() { 52 | NumberMarker nm1 = new NumberMarker(1.0); 53 | NumberMarker nm2 = new NumberMarker(1.0); 54 | assertTrue(nm1.equals(nm2)); 55 | assertFalse(nm1.equals(null)); 56 | 57 | nm1 = new NumberMarker(1.1); 58 | assertFalse(nm1.equals(nm2)); 59 | nm2 = new NumberMarker(1.1); 60 | assertTrue(nm1.equals(nm2)); 61 | } 62 | 63 | /** 64 | * Checks for serialization support. 65 | */ 66 | @Test 67 | public void testSerialization() { 68 | NumberMarker nm1 = new NumberMarker(1.0); 69 | NumberMarker nm2 = (NumberMarker) TestUtils.serialized(nm1); 70 | assertTrue(nm1.equals(nm2)); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/marker/RangeMarkerTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.marker; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertFalse; 36 | import static org.junit.jupiter.api.Assertions.assertTrue; 37 | 38 | import org.junit.jupiter.api.Test; 39 | 40 | import org.jfree.chart3d.TestUtils; 41 | 42 | /** 43 | * Tests for the {@link RangeMarker} class. 44 | */ 45 | public class RangeMarkerTest { 46 | 47 | /** 48 | * Some checks for the equals() method. 49 | */ 50 | @Test 51 | public void testEquals() { 52 | RangeMarker rm1 = new RangeMarker(1.0, 2.0); 53 | RangeMarker rm2 = new RangeMarker(1.0, 2.0); 54 | assertTrue(rm1.equals(rm2)); 55 | assertFalse(rm1.equals(null)); 56 | 57 | rm1 = new RangeMarker(1.1, 2.0); 58 | assertFalse(rm1.equals(rm2)); 59 | rm2 = new RangeMarker(1.1, 2.0); 60 | assertTrue(rm1.equals(rm2)); 61 | } 62 | 63 | /** 64 | * Checks for serialization support. 65 | */ 66 | @Test 67 | public void testSerialization() { 68 | RangeMarker rm1 = new RangeMarker(1.0, 2.0); 69 | RangeMarker rm2 = (RangeMarker) TestUtils.serialized(rm1); 70 | assertTrue(rm1.equals(rm2)); 71 | } 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/renderer/FixedColorScaleTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.renderer; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertFalse; 36 | import static org.junit.jupiter.api.Assertions.assertTrue; 37 | import org.junit.jupiter.api.Test; 38 | 39 | import org.jfree.chart3d.TestUtils; 40 | import java.awt.Color; 41 | 42 | /** 43 | * Tests for the {@link FixedColorScale} class. 44 | */ 45 | public class FixedColorScaleTest { 46 | 47 | @Test 48 | public void testEquals() { 49 | FixedColorScale fcs1 = new FixedColorScale(Color.YELLOW); 50 | FixedColorScale fcs2 = new FixedColorScale(Color.YELLOW); 51 | assertTrue(fcs1.equals(fcs2)); 52 | assertFalse(fcs1.equals(null)); 53 | 54 | fcs1 = new FixedColorScale(Color.BLUE); 55 | assertFalse(fcs1.equals(fcs2)); 56 | fcs2 = new FixedColorScale(Color.BLUE); 57 | assertTrue(fcs1.equals(fcs2)); 58 | } 59 | 60 | @Test 61 | public void testSerialization() { 62 | FixedColorScale fcs1 = new FixedColorScale(Color.YELLOW); 63 | FixedColorScale fcs2 = (FixedColorScale) TestUtils.serialized(fcs1); 64 | assertTrue(fcs1.equals(fcs2)); 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/renderer/RainbowScaleTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.renderer; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertFalse; 36 | import static org.junit.jupiter.api.Assertions.assertTrue; 37 | import org.junit.jupiter.api.Test; 38 | 39 | import org.jfree.chart3d.TestUtils; 40 | import org.jfree.chart3d.data.Range; 41 | 42 | /** 43 | * Tests for the {@link RainbowScale} class. 44 | */ 45 | public class RainbowScaleTest { 46 | 47 | @Test 48 | public void testEquals() { 49 | RainbowScale rs1 = new RainbowScale(new Range(5.0, 10.0)); 50 | RainbowScale rs2 = new RainbowScale(new Range(5.0, 10.0)); 51 | assertTrue(rs1.equals(rs2)); 52 | assertFalse(rs1.equals(null)); 53 | 54 | } 55 | 56 | @Test 57 | public void testSerialization() { 58 | RainbowScale rs1 = new RainbowScale(new Range(5.0, 10.0)); 59 | RainbowScale rs2 = (RainbowScale) TestUtils.serialized(rs1); 60 | assertTrue(rs1.equals(rs2)); 61 | } 62 | 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/renderer/category/StackedBarRenderer3DTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.renderer.category; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertFalse; 36 | import static org.junit.jupiter.api.Assertions.assertTrue; 37 | import org.junit.jupiter.api.Test; 38 | import org.jfree.chart3d.TestUtils; 39 | 40 | /** 41 | * Tests for the {@link StackedBarRenderer3D} class. 42 | */ 43 | public class StackedBarRenderer3DTest { 44 | 45 | /** 46 | * Some checks for the equals() method. 47 | */ 48 | @Test 49 | public void testEquals() { 50 | StackedBarRenderer3D r1 = new StackedBarRenderer3D(); 51 | StackedBarRenderer3D r2 = new StackedBarRenderer3D(); 52 | assertTrue(r1.equals(r2)); 53 | assertFalse(r1.equals(null)); 54 | 55 | // notify 56 | r1.setNotify(false); 57 | assertFalse(r1.equals(r2)); 58 | r2.setNotify(false); 59 | assertTrue(r1.equals(r2)); 60 | 61 | // ensure that we distinguish from the base class 62 | assertFalse(r1.equals(new BarRenderer3D())); 63 | } 64 | 65 | /** 66 | * Some checks for serialization. 67 | */ 68 | @Test 69 | public void testSerialization() { 70 | StackedBarRenderer3D r1 = new StackedBarRenderer3D(); 71 | StackedBarRenderer3D r2 = (StackedBarRenderer3D) 72 | TestUtils.serialized(r1); 73 | assertTrue(r1.equals(r2)); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/renderer/category/StandardCategoryColorSourceTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.renderer.category; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertFalse; 36 | import static org.junit.jupiter.api.Assertions.assertTrue; 37 | import org.junit.jupiter.api.Test; 38 | import java.awt.Color; 39 | import org.jfree.chart3d.TestUtils; 40 | 41 | /** 42 | * Tests for the {@link StandardCategoryColorSource} class. 43 | */ 44 | public class StandardCategoryColorSourceTest { 45 | 46 | @Test 47 | public void testEquals() { 48 | StandardCategoryColorSource s1 = new StandardCategoryColorSource(); 49 | StandardCategoryColorSource s2 = new StandardCategoryColorSource(); 50 | assertTrue(s1.equals(s2)); 51 | assertFalse(s1.equals(null)); 52 | 53 | s1 = new StandardCategoryColorSource(new Color[] { Color.BLUE }); 54 | assertFalse(s1.equals(s2)); 55 | s2 = new StandardCategoryColorSource(new Color[] { Color.BLUE }); 56 | assertTrue(s1.equals(s2)); 57 | } 58 | 59 | @Test 60 | public void testSerialization() { 61 | StandardCategoryColorSource s1 = new StandardCategoryColorSource(); 62 | StandardCategoryColorSource s2 = (StandardCategoryColorSource) 63 | TestUtils.serialized(s1); 64 | assertTrue(s1.equals(s2)); 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/renderer/xyz/ScatterXYZRendererTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.renderer.xyz; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertFalse; 36 | import static org.junit.jupiter.api.Assertions.assertTrue; 37 | import org.junit.jupiter.api.Test; 38 | import org.jfree.chart3d.TestUtils; 39 | 40 | /** 41 | * Tests for the {@link ScatterXYZRenderer} class. 42 | */ 43 | public class ScatterXYZRendererTest { 44 | 45 | @Test 46 | public void testEquals() { 47 | ScatterXYZRenderer r1 = new ScatterXYZRenderer(); 48 | ScatterXYZRenderer r2 = new ScatterXYZRenderer(); 49 | assertTrue(r1.equals(r2)); 50 | assertFalse(r1.equals(null)); 51 | 52 | r1.setSize(1.0); 53 | assertFalse(r1.equals(r2)); 54 | r2.setSize(1.0); 55 | assertTrue(r1.equals(r2)); 56 | } 57 | /** 58 | * Some checks for serialization support. 59 | */ 60 | @Test 61 | public void testSerialization() { 62 | ScatterXYZRenderer r1 = new ScatterXYZRenderer(); 63 | ScatterXYZRenderer r2 = (ScatterXYZRenderer) TestUtils.serialized(r1); 64 | assertTrue(r1.equals(r2)); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/table/ElementDimensionTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.table; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertFalse; 36 | import static org.junit.jupiter.api.Assertions.assertTrue; 37 | import org.junit.jupiter.api.Test; 38 | import org.jfree.chart3d.TestUtils; 39 | 40 | /** 41 | * Tests for the {@link ElementDimension} class. 42 | */ 43 | public class ElementDimensionTest { 44 | 45 | @Test 46 | public void testEquals() { 47 | ElementDimension ed1 = new ElementDimension(1.0, 2.0); 48 | ElementDimension ed2 = new ElementDimension(1.0, 2.0); 49 | assertTrue(ed1.equals(ed2)); 50 | assertFalse(ed1.equals(null)); 51 | 52 | ed1 = new ElementDimension(3.0, 2.0); 53 | assertFalse(ed1.equals(ed2)); 54 | ed2 = new ElementDimension(3.0, 2.0); 55 | assertTrue(ed1.equals(ed2)); 56 | 57 | ed1 = new ElementDimension(3.0, 4.0); 58 | assertFalse(ed1.equals(ed2)); 59 | ed2 = new ElementDimension(3.0, 4.0); 60 | assertTrue(ed1.equals(ed2)); 61 | } 62 | 63 | @Test 64 | public void testSerialization() { 65 | ElementDimension ed1 = new ElementDimension(1.0, 2.0); 66 | ElementDimension ed2 = (ElementDimension) TestUtils.serialized(ed1); 67 | assertTrue(ed1.equals(ed2)); 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/test/java/org/jfree/chart3d/table/GridElementTest.java: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * Orson Charts : a 3D chart library for the Java(tm) platform 3 | * =========================================================== 4 | * 5 | * (C)opyright 2013-present, by David Gilbert. All rights reserved. 6 | * 7 | * https://github.com/jfree/orson-charts 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 23 | * Other names may be trademarks of their respective owners.] 24 | * 25 | * If you do not wish to be bound by the terms of the GPL, an alternative 26 | * license is available to sponsors (higher tiers only) of the JFree projects. 27 | * For details, please see visit: 28 | * 29 | * https://github.com/sponsors/jfree 30 | * 31 | */ 32 | 33 | package org.jfree.chart3d.table; 34 | 35 | import static org.junit.jupiter.api.Assertions.assertFalse; 36 | import static org.junit.jupiter.api.Assertions.assertTrue; 37 | import org.junit.jupiter.api.Test; 38 | import org.jfree.chart3d.TestUtils; 39 | 40 | /** 41 | * Tests for the {@link GridElement} class. 42 | */ 43 | public class GridElementTest { 44 | 45 | @Test 46 | public void testEquals() { 47 | GridElement e1 = new GridElement<>(); 48 | GridElement e2 = new GridElement<>(); 49 | assertTrue(e1.equals(e2)); 50 | 51 | e1.setElement(new TextElement("A"), "R1", "C1"); 52 | assertFalse(e1.equals(e2)); 53 | e2.setElement(new TextElement("A"), "R1", "C1"); 54 | assertTrue(e1.equals(e2)); 55 | } 56 | 57 | /** 58 | * A check for serialization. 59 | */ 60 | @Test 61 | @SuppressWarnings("unchecked") 62 | public void testSerialization() { 63 | GridElement e1 = new GridElement<>(); 64 | GridElement e2 = (GridElement) TestUtils.serialized(e1); 65 | assertTrue(e1.equals(e2)); 66 | } 67 | } 68 | --------------------------------------------------------------------------------