From 03e61673a7efd6e6600180a4cec66c5be876a1d8 Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Mon, 26 Nov 2018 19:46:22 +0100 Subject: [PATCH] version 1.2018.13 --- pom.xml | 3 +- src/gen/lib/cdt/dtclose__c.java | 16 +- src/gen/lib/cdt/dtdisc__c.java | 8 +- src/gen/lib/cdt/dtopen__c.java | 4 +- src/gen/lib/cdt/dtrestore__c.java | 2 +- src/gen/lib/cdt/dttree__c.java | 50 +-- src/gen/lib/cdt/dtview__c.java | 24 +- src/gen/lib/cgraph/apply__c.java | 4 +- src/gen/lib/cgraph/attr__c.java | 56 +-- src/gen/lib/cgraph/edge__c.java | 98 +++-- src/gen/lib/cgraph/graph__c.java | 50 +-- src/gen/lib/cgraph/id__c.java | 14 +- src/gen/lib/cgraph/mem__c.java | 2 +- src/gen/lib/cgraph/node__c.java | 32 +- src/gen/lib/cgraph/obj__c.java | 14 +- src/gen/lib/cgraph/rec__c.java | 12 +- src/gen/lib/cgraph/refstr__c.java | 6 +- src/gen/lib/cgraph/subg__c.java | 17 +- src/gen/lib/cgraph/utils__c.java | 4 +- src/gen/lib/circogen/block__c.java | 4 +- src/gen/lib/circogen/blockpath__c.java | 4 +- src/gen/lib/circogen/blocktree__c.java | 4 +- src/gen/lib/circogen/circpos__c.java | 4 +- src/gen/lib/circogen/circular__c.java | 4 +- src/gen/lib/circogen/circularinit__c.java | 4 +- src/gen/lib/circogen/deglist__c.java | 4 +- src/gen/lib/circogen/edgelist__c.java | 4 +- src/gen/lib/circogen/nodelist__c.java | 4 +- src/gen/lib/circogen/nodeset__c.java | 4 +- src/gen/lib/common/args__c.java | 4 +- src/gen/lib/common/arrows__c.java | 19 +- src/gen/lib/common/ellipse__c.java | 4 +- src/gen/lib/common/emit__c.java | 36 +- src/gen/lib/common/geom__c.java | 14 +- src/gen/lib/common/globals__c.java | 4 +- src/gen/lib/common/htmllex__c.java | 4 +- src/gen/lib/common/htmlparse__c.java | 4 +- src/gen/lib/common/htmltable__c.java | 4 +- src/gen/lib/common/input__c.java | 14 +- src/gen/lib/common/labels__c.java | 59 +-- src/gen/lib/common/ns__c.java | 6 +- src/gen/lib/common/output__c.java | 4 +- src/gen/lib/common/pointset__c.java | 4 +- src/gen/lib/common/postproc__c.java | 109 +++-- src/gen/lib/common/psusershape__c.java | 4 +- src/gen/lib/common/routespl__c.java | 120 +++--- src/gen/lib/common/shapes__c.java | 184 ++++----- src/gen/lib/common/splines__c.java | 183 ++++---- src/gen/lib/common/textspan__c.java | 16 +- src/gen/lib/common/utils__c.java | 74 ++-- src/gen/lib/dotgen/acyclic__c.java | 4 +- src/gen/lib/dotgen/aspect__c.java | 4 +- src/gen/lib/dotgen/class1__c.java | 4 +- src/gen/lib/dotgen/class2__c.java | 14 +- src/gen/lib/dotgen/cluster__c.java | 48 +-- src/gen/lib/dotgen/compound__c.java | 4 +- src/gen/lib/dotgen/conc__c.java | 4 +- src/gen/lib/dotgen/decomp__c.java | 4 +- src/gen/lib/dotgen/dotinit__c.java | 12 +- src/gen/lib/dotgen/dotsplines__c.java | 344 ++++++++-------- src/gen/lib/dotgen/fastgr__c.java | 10 +- src/gen/lib/dotgen/flat__c.java | 72 ++-- src/gen/lib/dotgen/mincross__c.java | 199 +++++---- src/gen/lib/dotgen/position__c.java | 145 ++++--- src/gen/lib/dotgen/rank__c.java | 16 +- src/gen/lib/dotgen/sameport__c.java | 4 +- src/gen/lib/fdpgen/clusteredges__c.java | 4 +- src/gen/lib/fdpgen/comp__c.java | 4 +- src/gen/lib/fdpgen/fdpinit__c.java | 4 +- src/gen/lib/fdpgen/grid__c.java | 4 +- src/gen/lib/fdpgen/layout__c.java | 4 +- src/gen/lib/fdpgen/tlayout__c.java | 4 +- src/gen/lib/fdpgen/xlayout__c.java | 4 +- src/gen/lib/gvc/gvlayout__c.java | 20 +- src/gen/lib/gvc/gvrender__c.java | 4 +- src/gen/lib/label/index__c.java | 53 +-- src/gen/lib/label/node__c.java | 14 +- src/gen/lib/label/rectangle__c.java | 1 - src/gen/lib/label/split_q__c.java | 10 +- src/gen/lib/label/xlabels__c.java | 189 ++++----- src/gen/lib/ortho/ortho__c.java | 4 +- src/gen/lib/pack/ccomps__c.java | 4 +- src/gen/lib/pack/pack__c.java | 8 +- src/gen/lib/pack/ptest__c.java | 4 +- src/gen/lib/pathplan/route__c.java | 127 +++--- src/gen/lib/pathplan/shortest__c.java | 56 +-- src/h/Dthold_t.java | 57 --- src/h/ST_Agclos_s.java | 45 -- src/h/ST_Agdatadict_s.java | 33 +- src/h/ST_Agdisc_s.java | 10 - src/h/ST_Agdstate_s.java | 10 - src/h/ST_Agedge_s.java | 29 +- src/h/ST_Agedgeinfo_t.java | 97 ----- src/h/ST_Agedgepair_s.java | 13 - src/h/ST_Agiddisc_s.java | 25 -- src/h/ST_Agmemdisc_s.java | 16 - src/h/ST_Agnode_s.java | 37 +- src/h/ST_Agnodeinfo_t.java | 171 -------- src/h/ST_Agobj_s.java | 17 - src/h/ST_Agraph_s.java | 83 +--- src/h/ST_Agraphinfo_t.java | 146 +------ src/h/ST_Agrec_s.java | 33 +- src/h/ST_Agsubnode_s.java | 19 - src/h/ST_Agsym_s.java | 23 -- src/h/ST_BestPos_t.java | 31 +- src/h/ST_Branch_t.java | 58 +-- src/h/ST_GVCOMMON_t.java | 18 - src/h/ST_GVC_s.java | 13 - src/h/ST_HDict_t.java | 12 +- src/h/ST_LeafList_t.java | 36 +- src/h/ST_Leaf_t.java | 110 ----- src/h/ST_Node_t___.java | 18 +- src/h/ST_PartitionVars.java | 4 - src/h/ST_Pedge_t.java | 29 +- src/h/ST_Ppoly_t.java | 9 - src/h/ST_RTree.java | 57 +-- src/h/ST_SplitQ_t.java | 16 - src/h/ST_XLabels_t.java | 30 -- src/h/ST_adjmatrix_t.java | 11 - src/h/ST_arrowdir_t.java | 1 - src/h/ST_arrowtype_t.java | 1 - src/h/ST_aspect_t.java | 20 - src/h/ST_bezier.java | 51 +-- src/h/ST_boxf.java | 12 - src/h/ST_cinfo_t.java | 29 +- src/h/ST_dt_s.java | 47 --- src/h/ST_dtdata_s.java | 18 - src/h/ST_dtdisc_s.java | 35 -- src/h/ST_dthold_s.java | 14 +- src/h/ST_dtlink_s.java | 94 ++--- src/h/ST_dtmethod_s.java | 26 -- src/h/ST_fontinfo.java | 30 -- src/h/ST_gvlayout_engine_s.java | 27 +- src/h/ST_gvlayout_features_t.java | 7 - src/h/ST_gvplugin_active_layout_t.java | 17 +- src/h/ST_gvplugin_available_s.java | 1 - src/h/ST_gvplugin_installed_t.java | 31 +- src/h/ST_inside_t.java | 40 +- src/h/ST_label_params_t.java | 26 -- src/h/ST_layout_t.java | 57 --- src/h/ST_nodequeue.java | 18 - src/h/ST_object_t.java | 45 +- src/h/ST_pack_info.java | 28 +- src/h/ST_path.java | 37 -- src/h/ST_pathend_t.java | 23 -- src/h/ST_point.java | 12 - src/h/ST_pointf.java | 20 - src/h/ST_pointnlink_t.java | 12 - src/h/ST_polygon_t.java | 38 -- src/h/ST_port.java | 57 --- src/h/ST_rank_t.java | 99 +---- src/h/ST_shape_desc.java | 27 -- src/h/ST_shape_functions.java | 30 -- src/h/ST_splineInfo.java | 23 -- src/h/ST_spline_info_t.java | 19 - src/h/ST_splines.java | 10 - src/h/ST_tedge_t.java | 11 - src/h/ST_textlabel_t.java | 75 +--- src/h/ST_textspan_t.java | 29 -- src/h/ST_tna_t.java | 23 -- src/h/ST_triangle_t.java | 18 - src/h/ST_xlabel_t.java | 70 +--- src/h/_dthold_s.java | 66 --- src/net/sourceforge/plantuml/Annotated.java | 3 + .../sourceforge/plantuml/AnnotatedWorker.java | 74 +++- src/net/sourceforge/plantuml/BackSlash.java | 4 + .../sourceforge/plantuml/BlockUmlBuilder.java | 2 +- src/net/sourceforge/plantuml/ErrorUml.java | 4 +- src/net/sourceforge/plantuml/FontParam.java | 4 +- src/net/sourceforge/plantuml/ISkinParam.java | 2 +- src/net/sourceforge/plantuml/OptionFlags.java | 21 +- src/net/sourceforge/plantuml/OptionPrint.java | 1 + .../sourceforge/plantuml/PSystemBuilder.java | 2 + .../sourceforge/plantuml/PSystemError.java | 84 +++- src/net/sourceforge/plantuml/Run.java | 3 + src/net/sourceforge/plantuml/SkinParam.java | 19 +- .../plantuml/SkinParamDelegator.java | 4 +- .../plantuml/SourceFileReaderAbstract.java | 4 + src/net/sourceforge/plantuml/UmlDiagram.java | 14 +- .../sourceforge/plantuml/UmlDiagramType.java | 2 +- .../activitydiagram3/ActivityDiagram3.java | 7 +- .../activitydiagram3/InstructionGroup.java | 6 +- .../command/CommandGroup3.java | 2 +- .../command/CommandPartition3.java | 35 +- .../activitydiagram3/ftile/AbstractFtile.java | 2 +- .../activitydiagram3/ftile/FtileFactory.java | 2 +- .../ftile/FtileFactoryDelegator.java | 4 +- .../FtileFactoryDelegatorCreateGroup.java | 5 +- .../ftile/vcompact/FtileGroup.java | 12 +- .../ftile/vcompact/ParallelBuilderSplit2.java | 7 +- .../ftile/vcompact/VCompactFactory.java | 2 +- .../plantuml/command/CommandPragma.java | 8 +- .../plantuml/command/PSystemBasicFactory.java | 4 +- .../plantuml/command/UmlDiagramFactory.java | 1 + .../sequence/FactorySequenceNoteCommand.java | 4 +- .../plantuml/core/DiagramType.java | 5 +- .../sourceforge/plantuml/core/UmlSource.java | 82 ++-- .../plantuml/cucadiagram/Link.java | 1 - .../plantuml/cucadiagram/WithLinkType.java | 11 + .../cucadiagram/dot/GraphvizUtils.java | 2 +- .../cucadiagram/entity/EntityFactory.java | 12 + .../command/CommandLinkElement.java | 4 +- .../plantuml/donors/PSystemDonors.java | 30 +- .../flashcode/FlashCodeUtilsZxing.java | 2 +- .../plantuml/graphic/QuoteUtils.java | 7 +- .../plantuml/graphic/TextBlockRecentred.java | 5 +- .../sourceforge/plantuml/graphic/USymbol.java | 4 +- .../plantuml/graphic/USymbolFolder.java | 11 +- .../jdot/CucaDiagramFileMakerJDot.java | 8 +- .../sourceforge/plantuml/jdot/DebugUtils.java | 60 ++- .../sourceforge/plantuml/jdot/JDotPath.java | 46 ++- .../sourceforge/plantuml/preproc/Define.java | 42 +- .../plantuml/preproc/DefineSignature.java | 8 +- .../sourceforge/plantuml/preproc/Defines.java | 74 +++- .../plantuml/preproc/IfManager.java | 6 +- .../plantuml/preproc/IfManagerFilter.java | 4 +- .../plantuml/preproc/IfManagerNegatif.java | 2 +- .../plantuml/preproc/IfManagerPositif.java | 2 +- .../plantuml/preproc/Preprocessor.java | 93 ----- .../plantuml/preproc/PreprocessorDefine.java | 201 --------- .../plantuml/preproc/PreprocessorInclude.java | 370 ----------------- .../plantuml/preproc/ReadLineConcat.java | 72 ---- .../plantuml/preproc/ReadLineInsertable.java | 80 ---- .../preproc/ReadLineQuoteComment.java | 86 ---- .../plantuml/preproc/SubPreprocessor.java | 185 --------- .../plantuml/preproc2/Preprocessor2.java | 10 +- .../preproc2/PreprocessorDefine3Learner.java | 81 +--- .../preproc2/PreprocessorDefine4Apply.java | 62 +-- .../preproc2/PreprocessorInclude3.java | 51 ++- .../plantuml/preproc2/ReadLineAddConfig.java | 79 ---- .../plantuml/preproc2/SubPreprocessor2.java | 10 +- .../sourceforge/plantuml/project2/Day.java | 171 -------- .../plantuml/project2/GanttDiagram2.java | 112 ----- .../plantuml/project2/Knowledge.java | 118 ------ .../plantuml/project2/PSystemProject2.java | 128 ------ .../project2/PSystemProjectFactory2.java | 72 ---- .../plantuml/project2/Project2.java | 166 -------- .../plantuml/project2/Ressource.java | 46 --- .../sourceforge/plantuml/project2/Row.java | 52 --- .../plantuml/project2/RowMerge.java | 102 ----- .../plantuml/project2/RowOverwrite.java | 92 ----- .../plantuml/project2/RowSimple.java | 114 ----- .../plantuml/project2/RowUtils.java | 59 --- .../sourceforge/plantuml/project2/Task.java | 52 --- .../plantuml/project2/TaskAttribute.java | 64 --- .../plantuml/project2/TaskContainer.java | 42 -- .../plantuml/project2/TaskImpl.java | 90 ---- .../plantuml/project2/TaskMerge.java | 76 ---- .../plantuml/project2/TimeConverter.java | 46 --- .../plantuml/project2/TimeConverterDay.java | 112 ----- .../plantuml/project2/TimeElement.java | 50 --- .../plantuml/project2/TimeHeaderDay.java | 102 ----- .../plantuml/project2/TimeHeaderMonth.java | 119 ------ .../plantuml/project2/TimeLine.java | 48 --- .../plantuml/project2/TimeLineDay.java | 72 ---- .../plantuml/project2/TimeResolution.java | 40 -- .../plantuml/project2/TimeUtils.java | 66 --- .../sourceforge/plantuml/project2/Value.java | 39 -- .../plantuml/project2/ValueInt.java | 55 --- .../plantuml/project2/ValueTime.java | 49 --- .../project2/command/CommandAffectation.java | 61 --- .../project2/command/CommandCloseWeekDay.java | 56 --- ...lementBeforeOrAfterOrAtTaskStartOrEnd.java | 2 +- .../project3/ComplementSeveralDays.java | 12 +- .../plantuml/project3/GanttArrow.java | 4 +- .../plantuml/project3/GanttDiagram.java | 100 ++++- .../plantuml/project3/SubjectDaysAsDates.java | 35 +- .../sourceforge/plantuml/project3/Task.java | 2 +- .../plantuml/project3/TaskInstant.java | 12 +- .../plantuml/project3/VerbTaskStarts.java | 4 +- .../sequencediagram/command/CommandArrow.java | 7 +- .../command/CommandReturn.java | 43 +- .../sequencediagram/graphic/DrawableSet.java | 43 +- .../SequenceDiagramFileMakerPuma2.java | 11 +- .../teoz/SequenceDiagramFileMakerTeoz.java | 2 +- .../plantuml/skin/ArrowConfiguration.java | 51 ++- .../sourceforge/plantuml/skin/rose/Rose.java | 12 +- .../sourceforge/plantuml/svek/Cluster.java | 4 +- .../svek/CucaDiagramFileMakerSvek.java | 3 +- .../plantuml/svek/GraphvizCrash.java | 2 +- .../plantuml/svek/image/EntityImageClass.java | 4 +- .../svek/image/EntityImageDescription.java | 3 +- .../svek/image/EntityImageEmptyPackage.java | 2 +- .../plantuml/svek/image/EntityImageState.java | 3 +- .../EntityImageStateEmptyDescription.java | 3 +- .../plantuml/syntax/LanguageDescriptor.java | 1 + .../plantuml/timingdiagram/Histogram.java | 2 +- .../plantuml/timingdiagram/Player.java | 2 +- .../plantuml/timingdiagram/Ribbon.java | 2 +- .../plantuml/timingdiagram/RibbonNew.java | 2 +- .../plantuml/timingdiagram/RibbonOld.java | 2 +- .../plantuml/timingdiagram/TimingDiagram.java | 2 +- .../timingdiagram/TimingDiagramFactory.java | 5 +- .../plantuml/timingdiagram/TimingRuler.java | 2 +- .../AbstractUGraphicHorizontalLine.java | 4 + .../sourceforge/plantuml/ugraphic/MinMax.java | 5 +- .../plantuml/utils/StartUtils.java | 11 + .../sourceforge/plantuml/version/License.java | 37 +- .../plantuml/version/LicenseInfo.java | 158 +++++-- .../sourceforge/plantuml/version/Magic.java | 8 + .../plantuml/version/PSystemKeygen.java | 8 +- .../plantuml/version/PSystemVersion.java | 41 +- .../version/PSystemVersionFactory.java | 18 +- .../sourceforge/plantuml/version/Version.java | 4 +- src/smetana/core/CFunction.java | 4 +- src/smetana/core/CString.java | 1 - src/smetana/core/JUtils.java | 40 +- src/smetana/core/Macro.java | 389 +++++++++--------- src/smetana/core/UnsupportedArrayOfPtr.java | 40 -- .../core/UnsupportedArrayOfStruct2.java | 32 -- src/smetana/core/UnsupportedC.java | 31 -- src/smetana/core/UnsupportedStarStruct.java | 32 -- src/smetana/core/UnsupportedStruct.java | 33 -- src/smetana/core/__array_of_cstring__.java | 3 - .../core/__array_of_cstring_impl__.java | 8 - src/smetana/core/__array_of_double__.java | 1 - src/smetana/core/__array_of_ptr__.java | 8 - src/smetana/core/__c__fields.java | 8 - src/smetana/core/__ptr__.java | 2 - src/smetana/core/__struct__.java | 2 - .../core/amiga/StarArrayOfInteger.java | 1 - src/smetana/core/amiga/StarStruct.java | 20 - 322 files changed, 2863 insertions(+), 8523 deletions(-) delete mode 100644 src/h/Dthold_t.java delete mode 100644 src/h/ST_Leaf_t.java delete mode 100644 src/h/_dthold_s.java delete mode 100644 src/net/sourceforge/plantuml/preproc/Preprocessor.java delete mode 100644 src/net/sourceforge/plantuml/preproc/PreprocessorDefine.java delete mode 100644 src/net/sourceforge/plantuml/preproc/PreprocessorInclude.java delete mode 100644 src/net/sourceforge/plantuml/preproc/ReadLineConcat.java delete mode 100644 src/net/sourceforge/plantuml/preproc/ReadLineInsertable.java delete mode 100644 src/net/sourceforge/plantuml/preproc/ReadLineQuoteComment.java delete mode 100644 src/net/sourceforge/plantuml/preproc/SubPreprocessor.java delete mode 100644 src/net/sourceforge/plantuml/preproc2/ReadLineAddConfig.java delete mode 100644 src/net/sourceforge/plantuml/project2/Day.java delete mode 100644 src/net/sourceforge/plantuml/project2/GanttDiagram2.java delete mode 100644 src/net/sourceforge/plantuml/project2/Knowledge.java delete mode 100644 src/net/sourceforge/plantuml/project2/PSystemProject2.java delete mode 100644 src/net/sourceforge/plantuml/project2/PSystemProjectFactory2.java delete mode 100644 src/net/sourceforge/plantuml/project2/Project2.java delete mode 100644 src/net/sourceforge/plantuml/project2/Ressource.java delete mode 100644 src/net/sourceforge/plantuml/project2/Row.java delete mode 100644 src/net/sourceforge/plantuml/project2/RowMerge.java delete mode 100644 src/net/sourceforge/plantuml/project2/RowOverwrite.java delete mode 100644 src/net/sourceforge/plantuml/project2/RowSimple.java delete mode 100644 src/net/sourceforge/plantuml/project2/RowUtils.java delete mode 100644 src/net/sourceforge/plantuml/project2/Task.java delete mode 100644 src/net/sourceforge/plantuml/project2/TaskAttribute.java delete mode 100644 src/net/sourceforge/plantuml/project2/TaskContainer.java delete mode 100644 src/net/sourceforge/plantuml/project2/TaskImpl.java delete mode 100644 src/net/sourceforge/plantuml/project2/TaskMerge.java delete mode 100644 src/net/sourceforge/plantuml/project2/TimeConverter.java delete mode 100644 src/net/sourceforge/plantuml/project2/TimeConverterDay.java delete mode 100644 src/net/sourceforge/plantuml/project2/TimeElement.java delete mode 100644 src/net/sourceforge/plantuml/project2/TimeHeaderDay.java delete mode 100644 src/net/sourceforge/plantuml/project2/TimeHeaderMonth.java delete mode 100644 src/net/sourceforge/plantuml/project2/TimeLine.java delete mode 100644 src/net/sourceforge/plantuml/project2/TimeLineDay.java delete mode 100644 src/net/sourceforge/plantuml/project2/TimeResolution.java delete mode 100644 src/net/sourceforge/plantuml/project2/TimeUtils.java delete mode 100644 src/net/sourceforge/plantuml/project2/Value.java delete mode 100644 src/net/sourceforge/plantuml/project2/ValueInt.java delete mode 100644 src/net/sourceforge/plantuml/project2/ValueTime.java delete mode 100644 src/net/sourceforge/plantuml/project2/command/CommandAffectation.java delete mode 100644 src/net/sourceforge/plantuml/project2/command/CommandCloseWeekDay.java diff --git a/pom.xml b/pom.xml index 8d7a34924..49a345b11 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,8 @@ Script Author: Julien Eluard --> - + 4.0.0 net.sourceforge.plantuml diff --git a/src/gen/lib/cdt/dtclose__c.java b/src/gen/lib/cdt/dtclose__c.java index 95461c011..4468f0398 100644 --- a/src/gen/lib/cdt/dtclose__c.java +++ b/src/gen/lib/cdt/dtclose__c.java @@ -127,28 +127,28 @@ ENTERING("7ggbhlblmrfr1wq1k20npwyxb","dtclose"); try { ST_dtdisc_s disc; int ev = 0; - if(N(dt) || dt.getInt("nview") > 0 ) /* can't close if being viewed */ + if(N(dt) || dt.nview > 0 ) /* can't close if being viewed */ return -1; /* announce the close event to see if we should continue */ disc = (ST_dtdisc_s) dt.disc; - if(disc.getPtr("eventf")!=null && - (ev = (Integer)disc.call("eventf", dt, 2, null, disc)) < 0) + if(disc.eventf!=null && + (ev = (Integer)disc.eventf.exe(dt, 2, null, disc)) < 0) return -1; - if(dt.getPtr("view")!=null) /* turn off viewing */ + if(dt.view!=null) /* turn off viewing */ UNSUPPORTED("1xbo7gf92fmqmu2tzpfeuc0wk"); // dtview(dt,((Dt_t*)0)); if(ev == 0) /* release all allocated data */ { - dt.meth.call("searchf", dt, null, 0000100); + dt.meth.searchf.exe(dt, null, 0000100); if(dtsize_(dt) > 0) return -1; -if(dt.data.getInt("ntab") > 0) +if(dt.data.ntab > 0) UNSUPPORTED("4ugmcpi8vkb013vuo4wykn0a3"); // (*dt->memoryf)(dt,(void*)dt->data->hh._htab,0,disc); -dt.call("memoryf", dt, dt.data, null, disc); +dt.memoryf.exe(dt, dt.data, null, disc); } if(dt.type == 0) Memory.free(dt); else if(ev == 0 && dt.type == 1) UNSUPPORTED("6wqxv1f7tzvjk0lwmqdrcq8la"); // (*dt->memoryf)(dt, (void*)dt, 0, disc); - if(disc.getPtr("eventf")!=null) + if(disc.eventf!=null) UNSUPPORTED("8bce06bdd64ypwb17ddloqzu8"); // (void)(*disc->eventf)(dt, 6, ((void*)0), disc); return 0; } finally { diff --git a/src/gen/lib/cdt/dtdisc__c.java b/src/gen/lib/cdt/dtdisc__c.java index 90bba8bde..871ca01a5 100644 --- a/src/gen/lib/cdt/dtdisc__c.java +++ b/src/gen/lib/cdt/dtdisc__c.java @@ -159,18 +159,18 @@ try { ST_dtdisc_s old; if(N(old = (ST_dtdisc_s) dt.disc) ) /* initialization call from dtopen() */ { dt.setPtr("disc", disc); - if(N(dt.setPtr("memoryf", disc.getPtr("memoryf") ))) + if(N(dt.setPtr("memoryf", disc.memoryf ))) dt.setPtr("memoryf", function(dtdisc__c.class, "dtmemory")); return disc; } if(N(disc)) /* only want to know current discipline */ return old; - searchf = (Dtsearch_f) dt.meth.getPtr("searchf"); + searchf = (Dtsearch_f) dt.meth.searchf; if((dt.data.type&010000)!=0) dtrestore(dt,null); - if(old.getPtr("eventf")!=null && ((Integer)old.call("eventf", dt,3, disc,old)) < 0) + if(old.eventf!=null && ((Integer)old.eventf.exe(dt,3, disc,old)) < 0) return null; dt.setPtr("disc", disc); - if(N(dt.setPtr("memoryf", disc.getPtr("memoryf")))) + if(N(dt.setPtr("memoryf", disc.memoryf))) dt.setPtr("memoryf", function(dtdisc__c.class, "dtmemory")); if((dt.data.type&(0000040|0000100|0000020))!=0) UNSUPPORTED("e2tzh95k1lvjl6wbtpwizam8q"); // goto done; diff --git a/src/gen/lib/cdt/dtopen__c.java b/src/gen/lib/cdt/dtopen__c.java index 540e629e9..92d1f78e3 100644 --- a/src/gen/lib/cdt/dtopen__c.java +++ b/src/gen/lib/cdt/dtopen__c.java @@ -149,7 +149,7 @@ try { dt.setPtr("view", null); dt.setPtr("walk", null); dt.setPtr("user", null); - if(disc.getPtr("eventf")!=null) + if(disc.eventf!=null) { /* if shared/persistent dictionary, get existing data */ throw new UnsupportedOperationException(); // data = ((Dtdata_t*)0); @@ -176,7 +176,7 @@ try { // } } /* allocate sharable data */ - if(N(data = (ST_dtdata_s) (dt.call("memoryf", dt,null,sizeof(ST_dtdata_s.class),disc)) )) + if(N(data = (ST_dtdata_s) (dt.memoryf.exe(dt,null,sizeof(ST_dtdata_s.class),disc)) )) { err_open: Memory.free(dt); return (null); diff --git a/src/gen/lib/cdt/dtrestore__c.java b/src/gen/lib/cdt/dtrestore__c.java index df7d9d9b8..b20961c0a 100644 --- a/src/gen/lib/cdt/dtrestore__c.java +++ b/src/gen/lib/cdt/dtrestore__c.java @@ -127,7 +127,7 @@ try { ST_dtlink_s t; //Dtlink_t **s, **ends; int type; - Dtsearch_f searchf = (Dtsearch_f) dt.meth.getPtr("searchf"); + Dtsearch_f searchf = (Dtsearch_f) dt.meth.searchf; type = dt.data.type&010000; if(N(list)) /* restoring a flattened dictionary */ { if(N(type)) diff --git a/src/gen/lib/cdt/dttree__c.java b/src/gen/lib/cdt/dttree__c.java index 8f399ac30..4921198d8 100644 --- a/src/gen/lib/cdt/dttree__c.java +++ b/src/gen/lib/cdt/dttree__c.java @@ -58,7 +58,7 @@ import h.ST_dt_s; import h.ST_dtdisc_s; import h.ST_dthold_s; import h.ST_dtlink_s; -import h._dthold_s; +import h.ST_dthold_s; import smetana.core.CFunction; import smetana.core.CString; import smetana.core.__ptr__; @@ -150,10 +150,10 @@ try { Dtcompar_f cmpf; ST_dtdisc_s disc; if (((dt.data.type) & 010000) !=0) { dtrestore(dt,null); } - disc = (ST_dtdisc_s) dt.disc; ky = disc.getInt("key"); + disc = (ST_dtdisc_s) dt.disc; ky = disc.key; sz = disc.size; lk = disc.link; - cmpf = (Dtcompar_f) disc.getPtr("comparf"); + cmpf = (Dtcompar_f) disc.comparf; dt.setInt("type", dt.type&~0100000); root = (ST_dtlink_s) dt.data.here; if(N(obj)) @@ -161,7 +161,7 @@ try { return null; if((type&0000100)!=0) /* delete all objects */ { - if(disc.getPtr("freef")!=null || disc.link < 0) { + if(disc.freef!=null || disc.link < 0) { do { while((t = (ST_dtlink_s) root._left)!=null ) { root._left = t.right; @@ -169,11 +169,11 @@ try { root = t; } t = (ST_dtlink_s) root.right; - if(disc.getPtr("freef")!=null) + if(disc.freef!=null) throw new UnsupportedOperationException(); // (*disc->freef)(dt,(lk < 0 ? ((Dthold_t*)(root))->obj : (void*)((char*)(root) - lk) ),disc); if(disc.link < 0) - dt.call("memoryf", dt, root, null, disc); + dt.memoryf.exe(dt, root, null, disc); } while((root = t)!=null ); } dt.data.setInt("size", 0); @@ -196,7 +196,7 @@ try { } } dt.data.here = root; - return (lk < 0 ? root.castTo(_dthold_s.class).getPtr("obj") : root.addVirtualBytes(-lk) ); + return (lk < 0 ? root.castTo_ST_dthold_s().obj : root.addVirtualBytes(-lk) ); } } /* note that link.right is LEFT tree and link.left is RIGHT tree */ @@ -232,14 +232,14 @@ try { // if(root) // goto do_search; } - else if(root!=null && (lk < 0 ? (root.castTo(_dthold_s.class).getPtr("obj")!=null): NEQ(root.addVirtualBytes(-lk), obj))) + else if(root!=null && (lk < 0 ? (root.castTo_ST_dthold_s().obj!=null): NEQ(root.addVirtualBytes(-lk), obj))) { key = (sz < 0 ? ((__ptr__)obj).addVirtualBytes(ky) : ((__ptr__)obj).addVirtualBytes(ky)); throw new do_search(); } } catch (do_search do_search) { // do_search: if(dt.meth.type == 0000004 && - (minp = dt.data.getInt("minp")) != 0 && (type&(0001000|0000004))!=0) + (minp = dt.data.minp) != 0 && (type&(0001000|0000004))!=0) { /* simple search, note that minp should be even */ // for(t = root, n = 0; n < minp; ++n) // { k = (lk < 0 ? ((Dthold_t*)(t))->obj : (void*)((char*)(t) - lk) ); k = (void*)(sz < 0 ? *((char**)((char*)(k)+ky)) : ((char*)(k)+ky)); @@ -283,7 +283,7 @@ try { throw new UnsupportedOperationException("do_search1"); } while(true) { - k = lk < 0 ? root.castTo(_dthold_s.class).getPtr("obj") : root.addVirtualBytes(-lk); + k = lk < 0 ? root.castTo_ST_dthold_s().obj : root.addVirtualBytes(-lk); k = sz < 0 ? ((__ptr__)k).addVirtualBytes(ky) : ((__ptr__)k).addVirtualBytes(ky); if((cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(dt,key,k,disc) : (sz <= 0 ? strcmp((CString)key,(CString)k) : UNSUPPORTED_INT("memcmp(key,k,sz))") ))) == 0) @@ -291,7 +291,7 @@ try { else if(cmp < 0) { if((t = (ST_dtlink_s) root._left)!=null ) { - k = lk < 0 ? t.castTo(_dthold_s.class).getPtr("obj") : t.addVirtualBytes(-lk); + k = lk < 0 ? t.castTo_ST_dthold_s().obj : t.addVirtualBytes(-lk); k = sz < 0 ? ((__ptr__)k).addVirtualBytes(ky) : ((__ptr__)k).addVirtualBytes(ky); if((cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(dt,key,k,disc) : (sz <= 0 ? strcmp((CString)key,(CString)k) : UNSUPPORTED_INT("memcmp(key,k,sz))") ))) < 0) @@ -328,7 +328,7 @@ try { else /* if(cmp > 0) */ { if ((t = (ST_dtlink_s) root.right)!=null ) { - k = (lk < 0 ? t.castTo(_dthold_s.class).getPtr("obj") : t.addVirtualBytes(-lk) ); + k = (lk < 0 ? t.castTo_ST_dthold_s().obj : t.addVirtualBytes(-lk) ); k = sz < 0 ? ((__ptr__)k).addVirtualBytes(ky) : ((__ptr__)k).addVirtualBytes(ky); if((cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(dt,key,k,disc) : (sz <= 0 ? strcmp((CString)key,(CString)k) : UNSUPPORTED_INT("memcmp(key,k,sz))") ))) > 0) @@ -425,19 +425,19 @@ try { root.right = link._left; link._left = root; /*dt_insert: DUPLICATION*/ - if(disc.getPtr("makef")!=null && (type&0000001)!=0) - obj = (__ptr__) disc.call("makef", dt,obj,disc); + if(disc.makef!=null && (type&0000001)!=0) + obj = (__ptr__) disc.makef.exe(dt,obj,disc); if(obj!=null) { if(lk >= 0) root = (ST_dtlink_s) ((__ptr__)obj.addVirtualBytes(lk)).castTo(ST_dtlink_s.class); else { - root = (ST_dtlink_s)(((ST_dthold_s)dt.call("memoryf", - dt,null,sizeof(_dthold_s.class),disc)).castTo(ST_dtlink_s.class)); + root = (ST_dtlink_s)(((ST_dthold_s)dt.memoryf.exe( + dt,null,sizeof(ST_dthold_s.class),disc)).castTo(ST_dtlink_s.class)); if(root!=null) - root.castTo(_dthold_s.class).setPtr("obj", obj); - else if(disc.getPtr("makef")!=null && disc.getPtr("freef")!=null && + root.castTo(ST_dthold_s.class).setPtr("obj", obj); + else if(disc.makef!=null && disc.freef!=null && ((type&0000001))!=0) UNSUPPORTED("(*disc->freef)(dt,obj,disc);"); } @@ -494,19 +494,19 @@ try { } else if((type&(0000001|0004000))!=0) { /*dt_insert: DUPLICATION*/ - if(disc.getPtr("makef")!=null && (type&0000001)!=0) - obj = (__ptr__) disc.call("makef", dt,obj,disc); + if(disc.makef!=null && (type&0000001)!=0) + obj = (__ptr__) disc.makef.exe(dt,obj,disc); if(obj!=null) { if(lk >= 0) root = (ST_dtlink_s) ((__ptr__)obj.addVirtualBytes(lk)).castTo(ST_dtlink_s.class); else { - root = (ST_dtlink_s)(((ST_dthold_s)dt.call("memoryf", - dt,null,sizeof(_dthold_s.class),disc)).castTo(ST_dtlink_s.class)); + root = (ST_dtlink_s)(((ST_dthold_s)dt.memoryf.exe( + dt,null,sizeof(ST_dthold_s.class),disc)).castTo(ST_dtlink_s.class)); if(root!=null) - root.castTo(_dthold_s.class).setPtr("obj", obj); - else if(disc.getPtr("makef")!=null && disc.getPtr("freef")!=null && + root.castTo(ST_dthold_s.class).setPtr("obj", obj); + else if(disc.makef!=null && disc.freef!=null && ((type&0000001))!=0) UNSUPPORTED("(*disc->freef)(dt,obj,disc);"); } @@ -550,7 +550,7 @@ try { // } } dt.data.here = root; - return (lk < 0 ? root.castTo(_dthold_s.class).getPtr("obj") : root.addVirtualBytes(-lk)); + return (lk < 0 ? root.castTo_ST_dthold_s().obj : root.addVirtualBytes(-lk)); } catch (no_root no_root) { while((t = (ST_dtlink_s) r._left)!=null) r = t; diff --git a/src/gen/lib/cdt/dtview__c.java b/src/gen/lib/cdt/dtview__c.java index 6d58acaf7..f116d9057 100644 --- a/src/gen/lib/cdt/dtview__c.java +++ b/src/gen/lib/cdt/dtview__c.java @@ -138,11 +138,11 @@ try { Dtcompar_f cmpf; /* these operations only happen at the top level */ if ((type&(0000001|0000002|0000100|0000040))!=0) - return (__ptr__) dt.meth.call("searchf", dt, obj, type); + return (__ptr__) dt.meth.searchf.exe(dt, obj, type); if(((type&(0001000|0000004))!=0) || /* order sets first/last done below */ (((type&(0000200|0000400))!=0) && N(dt.meth.type&(0000010|0000004)) ) ) - { for(d = dt; d!=null; d = (ST_dt_s) d.getPtr("view")) - if((o = (__ptr__) d.meth.call("searchf", d,obj,type))!=null ) + { for(d = dt; d!=null; d = (ST_dt_s) d.view) + if((o = (__ptr__) d.meth.searchf.exe(d,obj,type))!=null ) break; dt.setPtr("walk", d); return o; @@ -151,13 +151,13 @@ try { { if(N(type & (0000200|0000400|0000010|0000020)) ) return null; n = nk = null; p = null; - for(d = dt; d!=null; d = (ST_dt_s) d.getPtr("view")) - { if(N(o = (__ptr__) d.meth.call("searchf", d, obj, type) )) + for(d = dt; d!=null; d = (ST_dt_s) d.view) + { if(N(o = (__ptr__) d.meth.searchf.exe(d, obj, type) )) continue; - ky = d.disc.getInt("key"); + ky = d.disc.key; sz = d.disc.size; lk = d.disc.link; - cmpf = (Dtcompar_f) d.disc.getPtr("comparf"); + cmpf = (Dtcompar_f) d.disc.comparf; ok = (__ptr__) (sz < 0 ? ((__ptr__)o).addVirtualBytes(ky) : ((__ptr__)o).addVirtualBytes(ky)); if(n!=null) /* get the right one among all dictionaries */ { cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(d,ok,nk,d.disc) : (sz <= 0 ? strcmp((CString)ok,(CString)nk) : UNSUPPORTED_INT("memcmp(ok,nk,sz)")) ); @@ -225,22 +225,22 @@ try { UNSUPPORTED("return null;"); } /* make sure there won't be a cycle */ - for(d = view; d!=null; d = (ST_dt_s)d.getPtr("view")) + for(d = view; d!=null; d = (ST_dt_s)d.view) if(EQ(d, dt)) return null; /* no more viewing lower dictionary */ - if((d = (ST_dt_s)dt.getPtr("view"))!=null ) - d.setInt("nview", d.getInt("nview")-1); + if((d = (ST_dt_s)dt.view)!=null ) + d.setInt("nview", d.nview-1); dt.setPtr("walk", null); dt.setPtr("view", null); if(N(view)) - { dt.setPtr("searchf", dt.meth.getPtr("searchf")); + { dt.setPtr("searchf", dt.meth.searchf); return d; } /* ok */ dt.setPtr("view", view); dt.setPtr("searchf", function(dtview__c.class, "dtvsearch")); - view.setInt("nview", view.getInt("nview")+1 ); + view.setInt("nview", view.nview+1 ); return view; } finally { LEAVING("dfryioch2xz35w8nq6lxbk5kh","dtview"); diff --git a/src/gen/lib/cgraph/apply__c.java b/src/gen/lib/cgraph/apply__c.java index 7b455aa88..840289c6b 100644 --- a/src/gen/lib/cgraph/apply__c.java +++ b/src/gen/lib/cgraph/apply__c.java @@ -56,8 +56,8 @@ import static smetana.core.Macro.AGRAPH; import static smetana.core.Macro.AGTYPE; import static smetana.core.Macro.N; import static smetana.core.Macro.UNSUPPORTED; -import h.ST_Agraph_s; import h.ST_Agobj_s; +import h.ST_Agraph_s; import smetana.core.CFunction; import smetana.core.__ptr__; @@ -233,7 +233,7 @@ throw new UnsupportedOperationException(); public static ST_Agobj_s subgraph_search(ST_Agraph_s sub, ST_Agobj_s g) { ENTERING("95y4aknoddh42lieikrb72vxw","subgraph_search"); try { - return (ST_Agobj_s) sub.castTo(ST_Agobj_s.class); + return (ST_Agobj_s) sub.castTo_ST_Agobj_s(); } finally { LEAVING("95y4aknoddh42lieikrb72vxw","subgraph_search"); } diff --git a/src/gen/lib/cgraph/attr__c.java b/src/gen/lib/cgraph/attr__c.java index 62a679f03..7596ba847 100644 --- a/src/gen/lib/cgraph/attr__c.java +++ b/src/gen/lib/cgraph/attr__c.java @@ -294,14 +294,14 @@ try { if (dd!=null) switch (kind) { case AGRAPH: - dict = (ST_dt_s) dd.getPtr("dict.g"); + dict = (ST_dt_s) dd.dict_g; break; case AGNODE: - dict = (ST_dt_s) dd.getPtr("dict.n"); + dict = (ST_dt_s) dd.dict_n; break; case AGINEDGE: case AGOUTEDGE: - dict = (ST_dt_s) dd.getPtr("dict.e"); + dict = (ST_dt_s) dd.dict_e; break; default: System.err.println("agdictof: unknown kind "+ kind); @@ -374,17 +374,17 @@ try { dd.setPtr("dict.g", agdtopen(g, Z.z().AgDataDictDisc, Z.z().Dttree)); if ((par = agparent(g))!=null) { parent_dd = agdatadict(par, false); - dtview((ST_dt_s)dd.getPtr("dict.n"), (ST_dt_s)parent_dd.getPtr("dict.n")); - dtview((ST_dt_s)dd.getPtr("dict.e"), (ST_dt_s)parent_dd.getPtr("dict.e")); - dtview((ST_dt_s)dd.getPtr("dict.g"), (ST_dt_s)parent_dd.getPtr("dict.g")); + dtview((ST_dt_s)dd.dict_n, (ST_dt_s)parent_dd.dict_n); + dtview((ST_dt_s)dd.dict_e, (ST_dt_s)parent_dd.dict_e); + dtview((ST_dt_s)dd.dict_g, (ST_dt_s)parent_dd.dict_g); } else { if (Z.z().ProtoGraph!=null && NEQ(g, Z.z().ProtoGraph)) { /* it's not ok to dtview here for several reasons. the proto graph could change, and the sym indices don't match */ parent_dd = agdatadict(Z.z().ProtoGraph, false); - agcopydict(parent_dd.getPtr("dict.n"), dd.getPtr("dict.n"), g, AGNODE); - agcopydict(parent_dd.getPtr("dict.e"), dd.getPtr("dict.e"), g, AGEDGE); - agcopydict(parent_dd.getPtr("dict.g"), dd.getPtr("dict.g"), g, AGRAPH); + agcopydict(parent_dd.dict_n, dd.dict_n, g, AGNODE); + agcopydict(parent_dd.dict_e, dd.dict_e, g, AGEDGE); + agcopydict(parent_dd.dict_g, dd.dict_g, g, AGRAPH); } } return dd; @@ -403,7 +403,7 @@ ENTERING("50wfzq5wy8wc7vuyvs3mrx5ct","agdictsym"); try { ST_Agsym_s key = (ST_Agsym_s) Memory.malloc(ST_Agsym_s.class); key.setPtr("name", name); - return (ST_Agsym_s) dict.call("searchf", (dict),key,0000004); + return (ST_Agsym_s) dict.searchf.exe((dict),key,0000004); } finally { LEAVING("50wfzq5wy8wc7vuyvs3mrx5ct","agdictsym"); } @@ -494,9 +494,9 @@ try { sz = 4; rec.str = new ArrayList(); for (int i=0; i= 4) + if (sym.id >= 4) // attr.str = (StarArrayOfCString) g.clos.disc.mem.call("resize", g.clos.state.mem, // attr.str, -// sizeof("char*", sym.getInt("id")), -// sizeof("char*", sym.getInt("id") + 1)); +// sizeof("char*", sym.id), +// sizeof("char*", sym.id + 1)); attr.str.add(null); - attr.str.set(sym.getInt("id"), agstrdup(g, sym.defval)); + attr.str.set(sym.id, agstrdup(g, sym.defval)); /* agmethod_upd(g,obj,sym); JCE and GN didn't like this. */ } finally { LEAVING("2io7b26wq70e7kwdlzsh6bw7f","addattr"); @@ -614,13 +614,13 @@ try { } else { psym = agdictsym(ldict, name); /* search with viewpath up to root */ if (psym!=null) { /* new local definition */ - lsym = agnewsym(g, name, value, psym.getInt("id"), kind); - ldict.castTo(ST_dt_s.class).call("searchf",ldict,lsym,0000001); + lsym = agnewsym(g, name, value, psym.id, kind); + ldict.searchf.exe(ldict,lsym,0000001); rv = lsym; } else { /* new global definition */ rdict = agdictof(root, kind); rsym = agnewsym(g, name, value, dtsize_(rdict), kind); - rdict.castTo(ST_dt_s.class).call("searchf",rdict,rsym,0000001); + rdict.searchf.exe(rdict,rsym,0000001); switch (kind) { case AGRAPH: agapply(root, (ST_Agobj_s) root.castTo(ST_Agobj_s.class), function(attr__c.class, "addattr"), @@ -726,7 +726,7 @@ try { /* Agdatadict_t *dd; */ /* Agrec_t *attr; */ ST_Agraph_s context; - ((ST_Agdesc_s)g.getStruct("desc")).has_attrs = 1; + ((ST_Agdesc_s)g.desc).has_attrs = 1; /* dd = */ agmakedatadict(g); if (N(context = agparent(g))) context = g; @@ -849,7 +849,7 @@ try { rv = null; /* note was "", but this provides more info */ else { data = agattrrec(obj.castTo(ST_Agobj_s.class)); - rv = data.str.get(sym.getInt("id")); + rv = data.str.get(sym.id); } return rv; } finally { @@ -869,7 +869,7 @@ try { CString rv; data = agattrrec(obj.castTo(ST_Agobj_s.class)); - rv = data.str.get(sym.getInt("id")); + rv = data.str.get(sym.id); return rv; } finally { LEAVING("9h5oymhfkp6k34zl0fonn10k9","agxget"); @@ -913,18 +913,18 @@ try { hdr = (ST_Agobj_s) obj.castTo(ST_Agobj_s.class); data = agattrrec(hdr); - agstrfree(g, data.str.get(sym.getInt("id"))); - data.str.set(sym.getInt("id"), agstrdup(g, value)); + agstrfree(g, data.str.get(sym.id)); + data.str.set(sym.id, agstrdup(g, value)); if (((ST_Agtag_s)hdr.tag).objtype == AGRAPH) { /* also update dict default */ ST_dt_s dict; - dict = (ST_dt_s) agdatadict(g, false).getPtr("dict.g"); + dict = (ST_dt_s) agdatadict(g, false).dict_g; if ((lsym = aglocaldictsym(dict, sym.name))!=null) { agstrfree(g, lsym.defval); lsym.setPtr("defval", agstrdup(g, value)); } else { - lsym = agnewsym(g, sym.name, value, sym.getInt("id"), AGTYPE(hdr)); - dict.call("searchf", dict, lsym, 0000001); + lsym = agnewsym(g, sym.name, value, sym.id, AGTYPE(hdr)); + dict.searchf.exe(dict, lsym, 0000001); } } agmethod_upd(g, obj, sym); diff --git a/src/gen/lib/cgraph/edge__c.java b/src/gen/lib/cgraph/edge__c.java index b9a4e0805..80a8816fd 100644 --- a/src/gen/lib/cgraph/edge__c.java +++ b/src/gen/lib/cgraph/edge__c.java @@ -79,13 +79,12 @@ import static smetana.core.Macro.AGTYPE; import static smetana.core.Macro.N; import static smetana.core.Macro.NOT; import static smetana.core.Macro.UNSUPPORTED; -import h.ST_Agedge_s; -import h.ST_Agraph_s; import h.ST_Agattr_s; import h.ST_Agdesc_s; import h.ST_Agedge_s; import h.ST_Agedgepair_s; import h.ST_Agnode_s; +import h.ST_Agraph_s; import h.ST_Agsubnode_s; import h.ST_Agtag_s; import h.ST_dt_s; @@ -93,7 +92,6 @@ import h.ST_dtdisc_s; import h.ST_dtlink_s; import smetana.core.ACCESS; import smetana.core.CString; -import smetana.core.Memory; import smetana.core.STARSTAR; import smetana.core.Z; import smetana.core.__ptr__; @@ -243,14 +241,14 @@ public static ST_Agedge_s agfstout(ST_Agraph_s g, ST_Agnode_s n) { ENTERING("9vamtktowqtk4955i546z9obw","agfstout"); try { ST_Agsubnode_s sn; - __ptr__ e = null; + ST_Agedge_s e = null; sn = agsubrep(g, n); if (sn!=null) { - dtrestore((ST_dt_s)g.getPtr("e_seq"), (ST_dtlink_s)sn.getPtr("out_seq")); - e = (__ptr__) g.getPtr("e_seq").castTo(ST_dt_s.class).call("searchf", g.getPtr("e_seq"),null,0000200); - sn.setPtr("out_seq", dtextract((ST_dt_s)g.getPtr("e_seq"))); + dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.out_seq); + e = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,null,0000200); + sn.out_seq = dtextract((ST_dt_s)g.e_seq); } - return e==null? null : (ST_Agedge_s) e.getPtr(); + return e; } finally { LEAVING("9vamtktowqtk4955i546z9obw","agfstout"); } @@ -266,15 +264,15 @@ ENTERING("1qh7mgqwomkdqvczauv4ex1lu","agnxtout"); try { ST_Agnode_s n; ST_Agsubnode_s sn; - __ptr__ f = null; + ST_Agedge_s f = null; n = AGTAIL(e); sn = agsubrep(g, n); if (sn!=null) { - dtrestore((ST_dt_s)g.getPtr("e_seq"), (ST_dtlink_s)sn.getPtr("out_seq")); - f = (__ptr__) g.getPtr("e_seq").castTo(ST_dt_s.class).call("searchf", g.getPtr("e_seq"),e,0000010); - sn.setPtr("out_seq", dtextract((ST_dt_s)g.getPtr("e_seq"))); + dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.out_seq); + f = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,e,0000010); + sn.out_seq = dtextract((ST_dt_s)g.e_seq); } - return f==null?null:(ST_Agedge_s)f.getPtr(); + return f; } finally { LEAVING("1qh7mgqwomkdqvczauv4ex1lu","agnxtout"); } @@ -289,14 +287,14 @@ public static ST_Agedge_s agfstin(ST_Agraph_s g, ST_Agnode_s n) { ENTERING("c60qt3ycq0xweabgtqt16xe93","agfstin"); try { ST_Agsubnode_s sn; - __ptr__ e = null; + ST_Agedge_s e = null; sn = agsubrep(g, n); if (sn!=null) { - dtrestore((ST_dt_s)g.getPtr("e_seq"), (ST_dtlink_s)sn.getPtr("in_seq")); - e = (__ptr__) g.getPtr("e_seq").castTo(ST_dt_s.class).call("searchf", g.getPtr("e_seq"),null,0000200); - sn.setPtr("in_seq", dtextract((ST_dt_s)g.getPtr("e_seq"))); + dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.in_seq); + e = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,null,0000200); + sn.setPtr("in_seq", dtextract((ST_dt_s)g.e_seq)); } - return e==null?null:(ST_Agedge_s)e.getPtr(); + return e; } finally { LEAVING("c60qt3ycq0xweabgtqt16xe93","agfstin"); } @@ -312,15 +310,15 @@ ENTERING("f2af4x97mqn16npd6alsw7avs","agnxtin"); try { ST_Agnode_s n; ST_Agsubnode_s sn; - __ptr__ f = null; + ST_Agedge_s f = null; n = AGHEAD(e); sn = agsubrep(g, n); if (sn!=null) { - dtrestore((ST_dt_s)g.getPtr("e_seq"), (ST_dtlink_s)sn.getPtr("in_seq")); - f = (__ptr__) g.getPtr("e_seq").castTo(ST_dt_s.class).call("searchf", g.getPtr("e_seq"),e,0000010); - sn.setPtr("in_seq", dtextract((ST_dt_s)g.getPtr("e_seq"))); + dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.in_seq); + f = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,e,0000010); + sn.setPtr("in_seq", dtextract((ST_dt_s)g.e_seq)); } - return f==null?null:(ST_Agedge_s)f.getPtr(); + return f; } finally { LEAVING("f2af4x97mqn16npd6alsw7avs","agnxtin"); } @@ -358,13 +356,13 @@ try { if (rv == null) { do { rv = N(rv) ? agfstin(g, n) : agnxtin(g,rv); - } while (rv!=null && EQ(rv.getPtr("node"), n)); + } while (rv!=null && EQ(rv.node, n)); } } else { do { rv = agnxtin(g, e); /* so that we only see each edge once, */ e = rv; - } while (rv!=null && EQ(rv.getPtr("node"), n)); /* ignore loops as in-edges */ + } while (rv!=null && EQ(rv.node, n)); /* ignore loops as in-edges */ } return rv; } finally { @@ -384,7 +382,7 @@ return agfindedge_by_key_w_(g, t, h, (ST_Agtag_s) key.copy()); private static ST_Agedge_s agfindedge_by_key_w_(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, final ST_Agtag_s key) { ENTERING("c175o6j61jqmfnl4o1g1h1mie","agfindedge_by_key"); try { - __ptr__ e; + ST_Agedge_s e; final ST_Agedge_s template = new ST_Agedge_s(); ST_Agsubnode_s sn; if ((t == null) || (h == null)) @@ -394,11 +392,11 @@ try { sn = agsubrep(g, h); if (N(sn)) e = null; else { - dtrestore((ST_dt_s)g.getPtr("e_id"), (ST_dtlink_s)sn.getPtr("in_id")); - e = ((__ptr__)g.getPtr("e_id").castTo(ST_dt_s.class).call("searchf", g.getPtr("e_id"),template,0000004)); - sn.setPtr("in_id", dtextract((ST_dt_s)g.getPtr("e_id"))); + dtrestore((ST_dt_s)g.e_id, (ST_dtlink_s)sn.in_id); + e = ((ST_Agedge_s)g.e_id.searchf.exe(g.e_id,template,0000004)); + sn.setPtr("in_id", dtextract((ST_dt_s)g.e_id)); } - return e==null?null:(ST_Agedge_s)e.getPtr(); + return e; } finally { LEAVING("c175o6j61jqmfnl4o1g1h1mie","agfindedge_by_key"); } @@ -433,10 +431,10 @@ ENTERING("b32ssm6ex1pdz1b3nt4fwlhul","agsubrep"); try { ST_Agsubnode_s sn; final ST_Agsubnode_s template = new ST_Agsubnode_s(); - if (EQ(g, n.getPtr("root"))) sn = (ST_Agsubnode_s) n.mainsub; + if (EQ(g, n.root)) sn = (ST_Agsubnode_s) n.mainsub; else { template.setPtr("node", n); - sn = (ST_Agsubnode_s) g.getPtr("n_id").castTo(ST_dt_s.class).call("searchf", g.getPtr("n_id"), template, 0000004); + sn = (ST_Agsubnode_s) g.n_id.searchf.exe(g.n_id, template, 0000004); } return sn; } finally { @@ -453,7 +451,7 @@ public static void ins(ST_dt_s d, STARSTAR set, ST_Agedge_s e) { ENTERING("6u0niow33w9gva780waluva4n","ins"); try { dtrestore(d, set.getMe()); - d.call("searchf", d,e,0000001); + d.searchf.exe(d,e,0000001); set.setMe(dtextract(d)); } finally { LEAVING("6u0niow33w9gva780waluva4n","ins"); @@ -496,38 +494,38 @@ try { while (g!=null) { if (agfindedge_by_key(g, t, h, AGTAG(e))!=null) break; sn = agsubrep(g, t); final ST_Agsubnode_s sn1 = sn; - ins((ST_dt_s)g.getPtr("e_seq"), + ins((ST_dt_s)g.e_seq, STARSTAR.amp(new ACCESS() { public ST_dtlink_s get() { - return (ST_dtlink_s) sn1.getPtr("out_seq"); + return (ST_dtlink_s) sn1.out_seq; } public void set(ST_dtlink_s obj) { sn1.setPtr("out_seq", obj); }}) , (ST_Agedge_s)out); - ins((ST_dt_s)g.getPtr("e_id"), + ins((ST_dt_s)g.e_id, STARSTAR.amp(new ACCESS() { public ST_dtlink_s get() { - return (ST_dtlink_s) sn1.getPtr("out_id"); + return (ST_dtlink_s) sn1.out_id; } public void set(ST_dtlink_s obj) { sn1.setPtr("out_id", obj); }}) , (ST_Agedge_s)out); sn = agsubrep(g, h); final ST_Agsubnode_s sn2 = sn; - ins((ST_dt_s)g.getPtr("e_seq"), + ins((ST_dt_s)g.e_seq, STARSTAR.amp(new ACCESS() { public ST_dtlink_s get() { - return (ST_dtlink_s) sn2.getPtr("in_seq"); + return (ST_dtlink_s) sn2.in_seq; } public void set(ST_dtlink_s obj) { sn2.setPtr("in_seq", obj); }}) , (ST_Agedge_s)in); - ins((ST_dt_s)g.getPtr("e_id"), + ins((ST_dt_s)g.e_id, STARSTAR.amp(new ACCESS() { public ST_dtlink_s get() { - return (ST_dtlink_s) sn2.getPtr("in_id"); + return (ST_dtlink_s) sn2.in_id; } public void set(ST_dtlink_s obj) { sn2.setPtr("in_id", obj); @@ -581,7 +579,7 @@ try { in.setPtr("node", t); out.setPtr("node", h); installedge(g, out); - if (((ST_Agdesc_s)g.getStruct("desc")).has_attrs!=0) { + if (((ST_Agdesc_s)g.desc).has_attrs!=0) { agbindrec(out, AgDataRecName, sizeof(ST_Agattr_s.class), false); agedgeattr_init(g, out); } @@ -792,14 +790,14 @@ LEAVING("30v8z3tlda81fbqbkzx6m9fkn","agsubedge"); //3 avk47eh26r45qk2dtoipwiqvz // int agedgeidcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc) -public static int agedgeidcmpf(ST_dt_s d, __ptr__ arg_e0, __ptr__ arg_e1, ST_dtdisc_s disc) { +public static int agedgeidcmpf(ST_dt_s d, ST_Agedge_s arg_e0, ST_Agedge_s arg_e1, ST_dtdisc_s disc) { ENTERING("avk47eh26r45qk2dtoipwiqvz","agedgeidcmpf"); try { int v; ST_Agedge_s e0, e1; - e0 = (ST_Agedge_s) arg_e0.getPtr(); - e1 = (ST_Agedge_s) arg_e1.getPtr(); - v = AGID(e0.getPtr("node")) - AGID(e1.getPtr("node")); + e0 = (ST_Agedge_s) arg_e0; + e1 = (ST_Agedge_s) arg_e1; + v = AGID(e0.node) - AGID(e1.node); if (v == 0) { /* same node */ if ((AGTYPE(e0) == 0) || (AGTYPE(e1) == 0)) v = 0; @@ -817,14 +815,14 @@ LEAVING("avk47eh26r45qk2dtoipwiqvz","agedgeidcmpf"); //3 b6jhzc16xvrknu4e7jp6zx0ue // int agedgeseqcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc) -public static int agedgeseqcmpf(ST_dt_s d, __ptr__ arg_e0, __ptr__ arg_e1, ST_dtdisc_s disc) { +public static int agedgeseqcmpf(ST_dt_s d, ST_Agedge_s arg_e0, ST_Agedge_s arg_e1, ST_dtdisc_s disc) { ENTERING("b6jhzc16xvrknu4e7jp6zx0ue","agedgeseqcmpf"); try { int v; ST_Agedge_s e0, e1; - e0 = (ST_Agedge_s) arg_e0.getPtr(); - e1 = (ST_Agedge_s) arg_e1.getPtr(); - if (NEQ(e0.getPtr("node"), e1.getPtr("node"))) v = AGSEQ(e0.getPtr("node")) - AGSEQ(e1.getPtr("node")); + e0 = (ST_Agedge_s) arg_e0; + e1 = (ST_Agedge_s) arg_e1; + if (NEQ(e0.node, e1.node)) v = AGSEQ(e0.node) - AGSEQ(e1.node); else v = (AGSEQ(e0) - AGSEQ(e1)); return ((v==0)?0:(v<0?-1:1)); } finally { diff --git a/src/gen/lib/cgraph/graph__c.java b/src/gen/lib/cgraph/graph__c.java index a784c3caa..b984e182e 100644 --- a/src/gen/lib/cgraph/graph__c.java +++ b/src/gen/lib/cgraph/graph__c.java @@ -69,12 +69,12 @@ import static smetana.core.Macro.ASINT; import static smetana.core.Macro.N; import static smetana.core.Macro.NOT; import static smetana.core.Macro.UNSUPPORTED; -import h.ST_Agdisc_s; -import h.ST_Agnode_s; -import h.ST_Agraph_s; import h.ST_Agclos_s; import h.ST_Agdesc_s; +import h.ST_Agdisc_s; import h.ST_Agmemdisc_s; +import h.ST_Agnode_s; +import h.ST_Agraph_s; import h.ST_Agsubnode_s; import h.ST_dt_s; import h.ST_dtdisc_s; @@ -233,14 +233,14 @@ try { __ptr__ memclosure; ST_Agclos_s rv; /* establish an allocation arena */ - memdisc = (ST_Agmemdisc_s) ((proto != null && proto.getPtr("mem") != null) ? proto.getPtr("mem") : Z.z().AgMemDisc); - memclosure = (__ptr__) memdisc.call("open", proto); - rv = (ST_Agclos_s) memdisc.call("alloc", memclosure, sizeof(ST_Agclos_s.class)); - rv.getStruct("disc").setPtr("mem", memdisc); - rv.getStruct("state").setPtr("mem", memclosure); - rv.getStruct("disc").setPtr("id", ((proto != null && proto.getPtr("id") != null) ? proto.getPtr("id") : Z.z().AgIdDisc)); + memdisc = (ST_Agmemdisc_s) ((proto != null && proto.mem != null) ? proto.mem : Z.z().AgMemDisc); + memclosure = (__ptr__) memdisc.open.exe(proto); + rv = (ST_Agclos_s) memdisc.alloc.exe(memclosure, sizeof(ST_Agclos_s.class)); + rv.disc.setPtr("mem", memdisc); + rv.state.setPtr("mem", memclosure); + rv.disc.setPtr("id", ((proto != null && proto.id != null) ? proto.id : Z.z().AgIdDisc)); // Translation bug in next line: should be AgIoDisc and not AgIdDisc - // rv.getStruct("disc").setPtr("io", ((proto != null && proto.getPtr("io") != null) ? proto.getPtr("io") : Z.z().AgIoDisc)); + // rv.disc.setPtr("io", ((proto != null && proto.getPtr("io") != null) ? proto.getPtr("io") : Z.z().AgIoDisc)); rv.callbacks_enabled = (N(0)); return rv; } finally { @@ -264,13 +264,13 @@ try { ST_Agclos_s clos; int gid[] = new int[1]; clos = agclos(arg_disc); - g = (ST_Agraph_s) clos.getStruct("disc").getPtr("mem").call("alloc", clos.getStruct("state").getPtr("mem"), sizeof(ST_Agraph_s.class)); + g = (ST_Agraph_s) clos.disc.mem.alloc.exe(clos.state.mem, sizeof(ST_Agraph_s.class)); AGTYPE(g, AGRAPH); g.setPtr("clos", clos); g.setStruct("desc", desc); - ((ST_Agdesc_s)g.getStruct("desc")).maingraph = ASINT((N(0))); + ((ST_Agdesc_s)g.desc).maingraph = ASINT((N(0))); g.setPtr("root", g); - g.clos.getStruct("state").setPtr("id", (__ptr__) g.clos.getStruct("disc").getPtr("id").call("open", g, arg_disc)); + g.clos.state.setPtr("id", (__ptr__) g.clos.disc.id.open.exe(g, arg_disc)); if (agmapnametoid(g, AGRAPH, name, gid, (N(0)))!=0) AGID(g, gid[0]); // /* else AGID(g) = 0 because we have no alternatives */ @@ -299,9 +299,9 @@ try { par = agparent(g); if (par!=null) { AGSEQ(g, agnextseq(par, AGRAPH)); - par.getPtr("g_dict").call("searchf", par.getPtr("g_dict"),g,0000001); + par.g_dict.searchf.exe(par.g_dict,g,0000001); } /* else AGSEQ=0 */ - if (N(par) || ((ST_Agdesc_s)par.getStruct("desc")).has_attrs!=0) + if (N(par) || ((ST_Agdesc_s)par.desc).has_attrs!=0) agraphattr_init(g); agmethod_init(g, g); return g; @@ -399,7 +399,7 @@ LEAVING("axmdmml95l55vlp1vqmh0v5sn","agnextseq"); public static int agnnodes(ST_Agraph_s g) { ENTERING("688euygrkbl10cveflgwalo2n","agnnodes"); try { - return dtsize_((ST_dt_s)g.getPtr("n_id")); + return dtsize_((ST_dt_s)g.n_id); } finally { LEAVING("688euygrkbl10cveflgwalo2n","agnnodes"); } @@ -445,7 +445,7 @@ throw new UnsupportedOperationException(); public static boolean agisdirected(ST_Agraph_s g) { ENTERING("blvn1w3v0icnucu5m5xvbrba1","agisdirected"); try { - return ((ST_Agdesc_s)g.getStruct("desc")).directed!=0; + return ((ST_Agdesc_s)g.desc).directed!=0; } finally { LEAVING("blvn1w3v0icnucu5m5xvbrba1","agisdirected"); } @@ -473,7 +473,7 @@ LEAVING("8thgds4eioot64flko26m8ns0","agisundirected"); public static boolean agisstrict(ST_Agraph_s g) { ENTERING("9qgdebmdfrcfjm394bg59a7y5","agisstrict"); try { - return ((ST_Agdesc_s)g.getStruct("desc")).strict!=0; + return ((ST_Agdesc_s)g.desc).strict!=0; } finally { LEAVING("9qgdebmdfrcfjm394bg59a7y5","agisstrict"); } @@ -550,19 +550,19 @@ try { sn = agsubrep(g, n); final ST_Agsubnode_s sn1 = sn; if (sn!=null) { - if (want_out) rv += cnt((ST_dt_s)g.getPtr("e_seq"), + if (want_out) rv += cnt((ST_dt_s)g.e_seq, STARSTAR.amp(new ACCESS() { public ST_dtlink_s get() { - return (ST_dtlink_s) sn1.getPtr("out_seq"); + return (ST_dtlink_s) sn1.out_seq; } public void set(ST_dtlink_s obj) { sn1.setPtr("out_seq", obj); }}) ); - if (want_in) rv += cnt((ST_dt_s)g.getPtr("e_seq"), + if (want_in) rv += cnt((ST_dt_s)g.e_seq, STARSTAR.amp(new ACCESS() { public ST_dtlink_s get() { - return (ST_dtlink_s) sn1.getPtr("in_seq"); + return (ST_dtlink_s) sn1.in_seq; } public void set(ST_dtlink_s obj) { sn1.setPtr("in_seq", obj); @@ -580,13 +580,13 @@ LEAVING("2bz40qf0qo7pd6er1ut25gthp","agdegree"); //3 dhbtfzzp8n5yygqmhmluo9bxl // int agraphidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc) -public static int agraphidcmpf(ST_dt_s d, __ptr__ arg0, __ptr__ arg1, ST_dtdisc_s disc) { +public static int agraphidcmpf(ST_dt_s d, ST_Agraph_s arg0, ST_Agraph_s arg1, ST_dtdisc_s disc) { ENTERING("dhbtfzzp8n5yygqmhmluo9bxl","agraphidcmpf"); try { int v; ST_Agraph_s sg0, sg1; - sg0 = (ST_Agraph_s) arg0.getPtr(); - sg1 = (ST_Agraph_s) arg1.getPtr(); + sg0 = (ST_Agraph_s) arg0; + sg1 = (ST_Agraph_s) arg1; v = (AGID(sg0) - AGID(sg1)); return ((v==0)?0:(v<0?-1:1)); } finally { diff --git a/src/gen/lib/cgraph/id__c.java b/src/gen/lib/cgraph/id__c.java index 7437d8a17..ec591af80 100644 --- a/src/gen/lib/cgraph/id__c.java +++ b/src/gen/lib/cgraph/id__c.java @@ -59,8 +59,8 @@ import static smetana.core.Macro.ASINT; import static smetana.core.Macro.N; import static smetana.core.Macro.UNSUPPORTED; import h.ST_Agdisc_s; -import h.ST_Agraph_s; import h.ST_Agobj_s; +import h.ST_Agraph_s; import smetana.core.CString; import smetana.core.Memory; import smetana.core.Z; @@ -341,7 +341,7 @@ ENTERING("aq30wwcj4ugatsgx0zdtdmeed","agmapnametoid"); try { int rv; if (str!=null && (str.charAt(0) != '%')) { - rv = (Integer) g.clos.getStruct("disc").getPtr("id").call("map", g.clos.getStruct("state").getPtr("id"), objtype, str, result, createflag); + rv = (Integer) g.clos.disc.id.map.exe(g.clos.state.id, objtype, str, result, createflag); if (rv!=0) return rv; } @@ -354,7 +354,7 @@ try { rv = 0; if (createflag) { /* get a new anonymous ID, and store in the internal map */ - rv = (Integer) g.clos.getStruct("disc").getPtr("id").call("map", g.clos.getStruct("state").getPtr("id"), objtype, null, result, + rv = (Integer) g.clos.disc.id.map.exe(g.clos.state.id, objtype, null, result, createflag); if (rv!=0 && str!=null) aginternalmapinsert(g, objtype, str, result[0]); @@ -409,15 +409,15 @@ try { g = agraphof(obj); if ((rv = aginternalmapprint(g, AGTYPE(obj), AGID(obj)))!=null) return rv; - if (g.clos.getStruct("disc").getPtr("id").getPtr("print")!=null) { + if (g.clos.disc.id.print!=null) { if ((rv = - (CString) g.clos.getStruct("disc").getPtr("id").call("print", g.clos.getStruct("state").getPtr("id"), + (CString) g.clos.disc.id.print.exe(g.clos.state.id, AGTYPE(obj), AGID(obj)))!=null) return rv; } if (AGTYPE(obj) != AGEDGE) { - rv = new CString("%"+((ST_Agobj_s)obj.castTo(ST_Agobj_s.class)).tag.getInt("id")); + rv = new CString("%"+((ST_Agobj_s)obj.castTo(ST_Agobj_s.class)).tag.id); } else rv = null; @@ -435,7 +435,7 @@ LEAVING("cctsybrl54fy799aynfej4iiy","agnameof"); public static void agregister(ST_Agraph_s g, int objtype, Object obj) { ENTERING("emt63ldde99jnwe2vvjal9kt9","agregister"); try { - g.clos.getStruct("disc").getPtr("id").call("idregister", g.clos.getStruct("state").getPtr("id"), objtype, obj); + g.clos.disc.id.idregister.exe(g.clos.state.id, objtype, obj); } finally { LEAVING("emt63ldde99jnwe2vvjal9kt9","agregister"); } diff --git a/src/gen/lib/cgraph/mem__c.java b/src/gen/lib/cgraph/mem__c.java index 29d363f96..fd2cac1e4 100644 --- a/src/gen/lib/cgraph/mem__c.java +++ b/src/gen/lib/cgraph/mem__c.java @@ -276,7 +276,7 @@ public static __ptr__ agalloc(ST_Agraph_s g, size_t size) { ENTERING("7newv1hmzvt4vtttc9cxdxfpn","agalloc"); try { __ptr__ mem; - mem = (__ptr__) g.clos.disc.mem.call("alloc", g.clos.state.mem, size); + mem = (__ptr__) g.clos.disc.mem.alloc.exe(g.clos.state.mem, size); if (mem == null) System.err.println("memory allocation failure"); return mem; diff --git a/src/gen/lib/cgraph/node__c.java b/src/gen/lib/cgraph/node__c.java index 77458084e..25c586065 100644 --- a/src/gen/lib/cgraph/node__c.java +++ b/src/gen/lib/cgraph/node__c.java @@ -68,10 +68,10 @@ import static smetana.core.Macro.AGSEQ; import static smetana.core.Macro.AGTYPE; import static smetana.core.Macro.N; import static smetana.core.Macro.UNSUPPORTED; -import h.ST_Agnode_s; -import h.ST_Agraph_s; import h.ST_Agattr_s; import h.ST_Agdesc_s; +import h.ST_Agnode_s; +import h.ST_Agraph_s; import h.ST_Agsubnode_s; import h.ST_Agtag_s; import h.ST_dt_s; @@ -225,8 +225,8 @@ try { ST_Agsubnode_s sn; ((ST_Agtag_s)Z.z().dummy.base.tag).id = id; Z.z().template.node = Z.z().dummy; - sn = (ST_Agsubnode_s) (g.getPtr("n_id").call("searchf", g.getPtr("n_id"), Z.z().template,0000004)); - return (ST_Agnode_s) (sn!=null ? sn.getPtr("node") : null); + sn = (ST_Agsubnode_s) (g.n_id.searchf.exe(g.n_id, Z.z().template,0000004)); + return (ST_Agnode_s) (sn!=null ? sn.node : null); } finally { LEAVING("4w89du6uel405pm3vxsr3ayxt","agfindnode_by_id"); } @@ -259,8 +259,8 @@ public static ST_Agnode_s agfstnode(ST_Agraph_s g) { ENTERING("55wopi2gd93zpmycxoywlxm0y","agfstnode"); try { ST_Agsubnode_s sn; - sn = (ST_Agsubnode_s) g.getPtr("n_seq").castTo(ST_dt_s.class).call("searchf", g.getPtr("n_seq"),null,0000200); - return sn!=null ? (ST_Agnode_s) sn.getPtr("node") : null; + sn = (ST_Agsubnode_s) g.n_seq.searchf.exe(g.n_seq,null,0000200); + return sn!=null ? (ST_Agnode_s) sn.node : null; } finally { LEAVING("55wopi2gd93zpmycxoywlxm0y","agfstnode"); } @@ -284,9 +284,9 @@ try { ST_Agsubnode_s sn; sn = agsubrep(g, n); LOG2("sn1="+sn); - if (sn!=null) sn = (ST_Agsubnode_s) g.getPtr("n_seq").castTo(ST_dt_s.class).call("searchf", g.getPtr("n_seq"),sn,0000010); + if (sn!=null) sn = (ST_Agsubnode_s) g.n_seq.searchf.exe(g.n_seq,sn,0000010); LOG2("sn2="+sn); - final __ptr__ result = sn!=null ? sn.getPtr("node") : null; + final __ptr__ result = sn!=null ? sn.node : null; LOG2("result="+result); return (ST_Agnode_s) result; } finally { @@ -341,7 +341,7 @@ try { AGID(n, id); AGSEQ(n, seq); n.setPtr("root", agroot(g)); - if (((ST_Agdesc_s)agroot(g).getStruct("desc")).has_attrs!=0) + if (((ST_Agdesc_s)agroot(g).desc).has_attrs!=0) agbindrec(n, AgDataRecName, sizeof(ST_Agattr_s.class), false); /* nodeattr_init and method_init will be called later, from the * subgraph where the node was actually created, but first it has @@ -362,12 +362,12 @@ ENTERING("4m26dpgaiw44hcleugjy71eus","installnode"); try { ST_Agsubnode_s sn; int osize; - osize = dtsize_((ST_dt_s)g.getPtr("n_id")); + osize = dtsize_((ST_dt_s)g.n_id); if (EQ(g, agroot(g))) sn = (ST_Agsubnode_s) n.mainsub; else sn = (ST_Agsubnode_s) ((__ptr__)agalloc(g, sizeof(ST_Agsubnode_s.class))).castTo(ST_Agsubnode_s.class); sn.setPtr("node", n); - g.getPtr("n_id").call("searchf", g.getPtr("n_id"),sn,0000001); - g.getPtr("n_seq").call("searchf", g.getPtr("n_seq"),sn,0000001); + g.n_id.searchf.exe(g.n_id,sn,0000001); + g.n_seq.searchf.exe(g.n_seq,sn,0000001); } finally { LEAVING("4m26dpgaiw44hcleugjy71eus","installnode"); } @@ -398,7 +398,7 @@ LEAVING("3mfxjcaeepn8nitirs3yoqaed","installnodetoroot"); public static void initnode(ST_Agraph_s g, ST_Agnode_s n) { ENTERING("85bb9mezhsgtzar3kqz95mq1","initnode"); try { - if (((ST_Agdesc_s)agroot(g).getStruct("desc")).has_attrs!=0) + if (((ST_Agdesc_s)agroot(g).desc).has_attrs!=0) agnodeattr_init(g,n); agmethod_init(g, n); } finally { @@ -593,7 +593,7 @@ ENTERING("d5farp22buvesyi4pydjam4g2","agsubnode"); try { ST_Agraph_s par; ST_Agnode_s n; - if (NEQ(agroot(g), n0.getPtr("root"))) + if (NEQ(agroot(g), n0.root)) return null; n = agfindnode_by_id(g, AGID(n0)); if ((n == null) && cflag) { @@ -623,7 +623,7 @@ try { ST_Agsubnode_s sn0, sn1; sn0 = (ST_Agsubnode_s) arg0.castTo(ST_Agsubnode_s.class); sn1 = (ST_Agsubnode_s) arg1.castTo(ST_Agsubnode_s.class); - v = (AGID(sn0.getPtr("node")) - AGID(sn1.getPtr("node"))); + v = (AGID(sn0.node) - AGID(sn1.node)); return ((v==0)?0:(v<0?-1:1)); } finally { LEAVING("awwiazixy9c76hvyxlkvvb3vo","agsubnodeidcmpf"); @@ -642,7 +642,7 @@ try { int v; sn0 = (ST_Agsubnode_s) arg0.castTo(ST_Agsubnode_s.class); sn1 = (ST_Agsubnode_s) arg1.castTo(ST_Agsubnode_s.class); - v = (AGSEQ(sn0.getPtr("node")) - AGSEQ(sn1.getPtr("node"))); + v = (AGSEQ(sn0.node) - AGSEQ(sn1.node)); return ((v==0)?0:(v<0?-1:1)); } finally { LEAVING("41fjseux0nxzpr0aq7igym9ux","agsubnodeseqcmpf"); diff --git a/src/gen/lib/cgraph/obj__c.java b/src/gen/lib/cgraph/obj__c.java index 91684d4eb..6412193a4 100644 --- a/src/gen/lib/cgraph/obj__c.java +++ b/src/gen/lib/cgraph/obj__c.java @@ -279,7 +279,7 @@ public static void agmethod_init(ST_Agraph_s g, __ptr__ obj) { ENTERING("c4ft3rxx9au29a2ns2nhod4dn","agmethod_init"); try { if (g.clos.callbacks_enabled) - aginitcb(g, obj, (Agcbstack_s) g.clos.getPtr("cb")); + aginitcb(g, obj, (Agcbstack_s) g.clos.cb); else agrecord_callback(g, obj, 100, null); } finally { @@ -330,7 +330,7 @@ public static void agmethod_upd(ST_Agraph_s g, __ptr__ obj, ST_Agsym_s sym) { ENTERING("29p743rx2pw81slkoaayfeael","agmethod_upd"); try { if (g.clos.callbacks_enabled) - agupdcb(g, obj, sym, (Agcbstack_s) g.clos.getPtr("cb")); + agupdcb(g, obj, sym, (Agcbstack_s) g.clos.cb); else agrecord_callback(g, obj, 101, sym); } finally { @@ -431,11 +431,11 @@ try { switch (AGTYPE(obj)) { case AGINEDGE: case AGOUTEDGE: - return (ST_Agraph_s) obj.castTo(ST_Agedge_s.class).getPtr("node").getPtr("root"); + return (ST_Agraph_s) ((ST_Agedge_s)obj.castTo(ST_Agedge_s.class)).node.root; case AGNODE: - return (ST_Agraph_s) obj.castTo(ST_Agnode_s.class).getPtr("root"); + return (ST_Agraph_s) ((ST_Agnode_s)obj.castTo(ST_Agnode_s.class)).root; case AGRAPH: - return (ST_Agraph_s) obj.castTo(ST_Agraph_s.class).getPtr("root"); + return (ST_Agraph_s) ((ST_Agraph_s)obj.castTo(ST_Agraph_s.class)).root; default: /* actually can't occur if only 2 bit tags */ System.err.println("agroot of a bad object"); return null; @@ -456,9 +456,9 @@ try { switch (AGTYPE(obj)) { case AGINEDGE: case AGOUTEDGE: - return (ST_Agraph_s) obj.castTo(ST_Agedge_s.class).getPtr("node").getPtr("root").castTo(ST_Agraph_s.class); + return (ST_Agraph_s) ((ST_Agedge_s)obj.castTo(ST_Agedge_s.class)).node.root.castTo(ST_Agraph_s.class); case AGNODE: - return (ST_Agraph_s) obj.castTo(ST_Agnode_s.class).getPtr("root").castTo(ST_Agraph_s.class); + return (ST_Agraph_s) ((ST_Agnode_s)obj.castTo(ST_Agnode_s.class)).root.castTo(ST_Agraph_s.class); case AGRAPH: return (ST_Agraph_s) obj.castTo(ST_Agraph_s.class); default: /* actually can't occur if only 2 bit tags */ diff --git a/src/gen/lib/cgraph/rec__c.java b/src/gen/lib/cgraph/rec__c.java index 10d4626e0..bd31c9acc 100644 --- a/src/gen/lib/cgraph/rec__c.java +++ b/src/gen/lib/cgraph/rec__c.java @@ -64,8 +64,8 @@ import static smetana.core.Macro.N; import static smetana.core.Macro.NOT; import static smetana.core.Macro.UNSUPPORTED; import h.ST_Agedge_s; -import h.ST_Agraph_s; import h.ST_Agobj_s; +import h.ST_Agraph_s; import h.ST_Agrec_s; import h.ST_Agtag_s; import smetana.core.CString; @@ -273,14 +273,14 @@ try { newrec = (ST_Agrec_s) arg; firstrec = (ST_Agrec_s) obj.data; if (firstrec == null) - newrec.setPtr("next", newrec); /* 0 elts */ + newrec.next = newrec; /* 0 elts */ else { if (EQ(firstrec.next, firstrec)) { - firstrec.setPtr("next", newrec); /* 1 elt */ - newrec.setPtr("next", firstrec); + firstrec.next = newrec; /* 1 elt */ + newrec.next = firstrec; } else { - newrec.setPtr("next", firstrec.next); - firstrec.setPtr("next", newrec); + newrec.next = firstrec.next; + firstrec.next = newrec; } } if (NOT(((ST_Agtag_s)obj.tag).mtflock)) diff --git a/src/gen/lib/cgraph/refstr__c.java b/src/gen/lib/cgraph/refstr__c.java index 38824ac14..c7d699aaa 100644 --- a/src/gen/lib/cgraph/refstr__c.java +++ b/src/gen/lib/cgraph/refstr__c.java @@ -232,7 +232,7 @@ try { if (g != null) dictref = STARSTAR.amp(new ACCESS() { public ST_dt_s get() { - return (ST_dt_s) g.clos.getPtr("strdict"); + return (ST_dt_s) g.clos.strdict; } public void set(ST_dt_s obj) { g.clos.setPtr("strdict", obj); @@ -284,7 +284,7 @@ try { ST_refstr_t r; // key.setPtr("s", s.duplicate()); key.setString(s); - r = (ST_refstr_t) strdict.call("searchf", strdict, key, 0000004); + r = (ST_refstr_t) strdict.searchf.exe(strdict, key, 0000004); return r; } finally { LEAVING("9ts4wqhw2xafdv3tlcilneewq","refsymbind"); @@ -351,7 +351,7 @@ try { r.setString(s.duplicate()); // strcpy(r->store, s); // r->s = r->store; - strdict.call("searchf", strdict,r,0000001); + strdict.searchf.exe(strdict,r,0000001); } return r.s; } finally { diff --git a/src/gen/lib/cgraph/subg__c.java b/src/gen/lib/cgraph/subg__c.java index d84ac30f4..58e4ff1fb 100644 --- a/src/gen/lib/cgraph/subg__c.java +++ b/src/gen/lib/cgraph/subg__c.java @@ -56,7 +56,6 @@ import static smetana.core.Macro.AGID; import static smetana.core.Macro.AGRAPH; import static smetana.core.Macro.N; import static smetana.core.Macro.UNSUPPORTED; -import h.ST_Agraph_s; import h.ST_Agdesc_s; import h.ST_Agraph_s; import h.ST_dt_s; @@ -205,9 +204,9 @@ public static ST_Agraph_s agfindsubg_by_id(ST_Agraph_s g, int id) { ENTERING("11ezyrsjsotjz9b3cyvb4ie8p","agfindsubg_by_id"); try { final ST_Agraph_s template = new ST_Agraph_s(); - agdtdisc(g, (ST_dt_s) g.getPtr("g_dict"), Z.z().Ag_subgraph_id_disc); + agdtdisc(g, (ST_dt_s) g.g_dict, Z.z().Ag_subgraph_id_disc); AGID(template, id); - return (ST_Agraph_s) g.getPtr("g_dict").castTo(ST_dt_s.class).call("searchf", g.getPtr("g_dict"), template, 0000004); + return (ST_Agraph_s) g.g_dict.searchf.exe(g.g_dict, template, 0000004); } finally { LEAVING("11ezyrsjsotjz9b3cyvb4ie8p","agfindsubg_by_id"); } @@ -227,10 +226,10 @@ try { return subg; subg = (ST_Agraph_s) agalloc(g, sizeof(ST_Agraph_s.class)); subg.setPtr("clos", g.clos); - subg.setStruct("desc", g.getStruct("desc")); - ((ST_Agdesc_s)subg.getStruct("desc")).maingraph = 0; + subg.setStruct("desc", g.desc); + ((ST_Agdesc_s)subg.desc).maingraph = 0; subg.setPtr("parent", g); - subg.setPtr("root", g.getPtr("root")); + subg.setPtr("root", g.root); AGID(subg, id); return agopen1(subg); } finally { @@ -290,7 +289,7 @@ LEAVING("a24jd4r2sdyb4lb2hyababrda","agsubg"); public static ST_Agraph_s agfstsubg(ST_Agraph_s g) { ENTERING("51eksrs0lhkgohunejlpwyc4k","agfstsubg"); try { - __ptr__ tmp = (__ptr__)g.getPtr("g_dict").castTo(ST_dt_s.class).call("searchf", g.getPtr("g_dict"),null,0000200); + __ptr__ tmp = (__ptr__)g.g_dict.searchf.exe(g.g_dict,null,0000200); if (tmp!=null) tmp = tmp.castTo(ST_Agraph_s.class); return (ST_Agraph_s) tmp; } finally { @@ -309,7 +308,7 @@ try { ST_Agraph_s g; g = agparent(subg); if (g==null) return null; - __ptr__ tmp = (__ptr__) g.getPtr("g_dict").castTo(ST_dt_s.class).call("searchf", g.getPtr("g_dict"), subg, 0000010); + __ptr__ tmp = (__ptr__) g.g_dict.searchf.exe(g.g_dict, subg, 0000010); if (tmp==null) return null; return (ST_Agraph_s) tmp.getPtr(); } finally { @@ -325,7 +324,7 @@ LEAVING("85c1qisrein0tzm2regoe61t","agnxtsubg"); public static ST_Agraph_s agparent(ST_Agraph_s g) { ENTERING("7kbp6j03hd7u6nnlivi0vt3ja","agparent"); try { - return (ST_Agraph_s) g.getPtr("parent"); + return (ST_Agraph_s) g.parent; } finally { LEAVING("7kbp6j03hd7u6nnlivi0vt3ja","agparent"); } diff --git a/src/gen/lib/cgraph/utils__c.java b/src/gen/lib/cgraph/utils__c.java index 710187658..3b4913bed 100644 --- a/src/gen/lib/cgraph/utils__c.java +++ b/src/gen/lib/cgraph/utils__c.java @@ -53,8 +53,8 @@ import static smetana.core.JUtils.function; import static smetana.core.JUtilsDebug.ENTERING; import static smetana.core.JUtilsDebug.LEAVING; import static smetana.core.Macro.UNSUPPORTED; -import h.ST_Agraph_s; import h.Dtmemory_f; +import h.ST_Agraph_s; import h.ST_dt_s; import h.ST_dtdisc_s; import h.ST_dtmethod_s; @@ -256,7 +256,7 @@ ENTERING("48ox0bg1qmasrer8np51uwsyk","agdtopen"); try { Dtmemory_f memf; ST_dt_s d; - memf = (Dtmemory_f) disc.getPtr("memoryf"); + memf = (Dtmemory_f) disc.memoryf; disc.setPtr("memoryf", function(utils__c.class, "agdictobjmem")); Z.z().Ag_dictop_G = g; d = dtopen(disc, method); diff --git a/src/gen/lib/circogen/block__c.java b/src/gen/lib/circogen/block__c.java index b25fae27e..51ba70b94 100644 --- a/src/gen/lib/circogen/block__c.java +++ b/src/gen/lib/circogen/block__c.java @@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/circogen/blockpath__c.java b/src/gen/lib/circogen/blockpath__c.java index e54207d15..c39f8686e 100644 --- a/src/gen/lib/circogen/blockpath__c.java +++ b/src/gen/lib/circogen/blockpath__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/circogen/blocktree__c.java b/src/gen/lib/circogen/blocktree__c.java index de4bf4909..f94e66e91 100644 --- a/src/gen/lib/circogen/blocktree__c.java +++ b/src/gen/lib/circogen/blocktree__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/circogen/circpos__c.java b/src/gen/lib/circogen/circpos__c.java index 76c443ef1..435b70ad5 100644 --- a/src/gen/lib/circogen/circpos__c.java +++ b/src/gen/lib/circogen/circpos__c.java @@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/circogen/circular__c.java b/src/gen/lib/circogen/circular__c.java index 19595a24e..b26bd87ea 100644 --- a/src/gen/lib/circogen/circular__c.java +++ b/src/gen/lib/circogen/circular__c.java @@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/circogen/circularinit__c.java b/src/gen/lib/circogen/circularinit__c.java index 7e72f5e5b..d6df1231f 100644 --- a/src/gen/lib/circogen/circularinit__c.java +++ b/src/gen/lib/circogen/circularinit__c.java @@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/circogen/deglist__c.java b/src/gen/lib/circogen/deglist__c.java index 4daeb95e1..9362984e7 100644 --- a/src/gen/lib/circogen/deglist__c.java +++ b/src/gen/lib/circogen/deglist__c.java @@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/circogen/edgelist__c.java b/src/gen/lib/circogen/edgelist__c.java index 30cb46e34..89050e742 100644 --- a/src/gen/lib/circogen/edgelist__c.java +++ b/src/gen/lib/circogen/edgelist__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/circogen/nodelist__c.java b/src/gen/lib/circogen/nodelist__c.java index f507e6dd1..5784fd3d5 100644 --- a/src/gen/lib/circogen/nodelist__c.java +++ b/src/gen/lib/circogen/nodelist__c.java @@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/circogen/nodeset__c.java b/src/gen/lib/circogen/nodeset__c.java index 4e9cd2fc9..98f15a50f 100644 --- a/src/gen/lib/circogen/nodeset__c.java +++ b/src/gen/lib/circogen/nodeset__c.java @@ -372,8 +372,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/common/args__c.java b/src/gen/lib/common/args__c.java index cf508f5a5..53893b259 100644 --- a/src/gen/lib/common/args__c.java +++ b/src/gen/lib/common/args__c.java @@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/common/arrows__c.java b/src/gen/lib/common/arrows__c.java index b46186a80..5f3d48e93 100644 --- a/src/gen/lib/common/arrows__c.java +++ b/src/gen/lib/common/arrows__c.java @@ -66,7 +66,6 @@ import h.ST_pointf; import smetana.core.CString; import smetana.core.MutableDouble; import smetana.core.Z; -import smetana.core.__ptr__; public class arrows__c { //1 2digov3edok6d5srhgtlmrycs @@ -393,8 +392,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -896,7 +895,7 @@ return inside_w_(inside_context, p.copy()); private static boolean inside_w_(ST_inside_t inside_context, final ST_pointf p) { ENTERING("7ymcsnwqkr1crisrga0kezh1f","inside"); try { - return DIST2(p, inside_context.getPtr("a.p").plus(0).getPtr()) <= inside_context.getPtr("a.r").getDouble(); + return DIST2(p, inside_context.a_p.get(0)) <= inside_context.a_r.getDouble(); } finally { LEAVING("7ymcsnwqkr1crisrga0kezh1f","inside"); } @@ -907,7 +906,7 @@ LEAVING("7ymcsnwqkr1crisrga0kezh1f","inside"); //3 9eellwhg4gsa2pdszpeqihs2d // int arrowEndClip(edge_t* e, pointf * ps, int startp, int endp, bezier * spl, int eflag) -public static int arrowEndClip(ST_Agedge_s e, __ptr__ ps, int startp, int endp, ST_bezier spl, int eflag) { +public static int arrowEndClip(ST_Agedge_s e, ST_pointf.Array ps, int startp, int endp, ST_bezier spl, int eflag) { ENTERING("9eellwhg4gsa2pdszpeqihs2d","arrowEndClip"); try { final ST_inside_t inside_context = new ST_inside_t(); @@ -918,13 +917,13 @@ try { elen2.setValue(elen * elen); spl.setInt("eflag", eflag); spl.setStruct("ep", ps.plus(endp + 3).getStruct()); - if (endp > startp && DIST2(ps.plus(endp).getPtr(), ps.plus(endp + 3).getPtr()) < elen2.getValue()) { + if (endp > startp && DIST2(ps.get(endp), ps.get(endp + 3)) < elen2.getValue()) { endp -= 3; } sp.plus(3).setStruct(ps.plus(endp).getStruct()); sp.plus(2).setStruct(ps.plus(endp+1).getStruct()); sp.plus(1).setStruct(ps.plus(endp+2).getStruct()); - sp.plus(0).setStruct(spl.getStruct("ep")); + sp.plus(0).setStruct(spl.ep); /* ensure endpoint starts inside */ inside_context.setPtr("a.p", sp.plus(0).asPtr()); inside_context.setPtr("a.r", elen2.amp()); @@ -944,7 +943,7 @@ LEAVING("9eellwhg4gsa2pdszpeqihs2d","arrowEndClip"); //3 q7y4oxn0paexbgynmtg2zmiv // int arrowStartClip(edge_t* e, pointf * ps, int startp, int endp, bezier * spl, int sflag) -public static int arrowStartClip(ST_Agedge_s e, __ptr__ ps, int startp, int endp, ST_bezier spl, int sflag) { +public static int arrowStartClip(ST_Agedge_s e, ST_pointf.Array ps, int startp, int endp, ST_bezier spl, int sflag) { ENTERING("q7y4oxn0paexbgynmtg2zmiv","arrowStartClip"); try { final ST_inside_t inside_context = new ST_inside_t(); @@ -955,13 +954,13 @@ try { slen2.setValue(slen * slen); spl.setInt("sflag", sflag); spl.setStruct("sp", ps.plus(startp).getStruct()); - if (endp > startp && DIST2(ps.plus(startp).getPtr(), ps.plus(startp + 3).getPtr()) < slen2.getValue()) { + if (endp > startp && DIST2(ps.get(startp), ps.get(startp + 3)) < slen2.getValue()) { startp += 3; } sp.plus(0).setStruct(ps.plus(startp+3).getStruct()); sp.plus(1).setStruct(ps.plus(startp+2).getStruct()); sp.plus(2).setStruct(ps.plus(startp+1).getStruct()); - sp.plus(3).setStruct(spl.getStruct("sp")); + sp.plus(3).setStruct(spl.sp); /* ensure endpoint starts inside */ inside_context.setPtr("a.p", sp.plus(3).asPtr()); inside_context.setPtr("a.r", slen2.amp()); diff --git a/src/gen/lib/common/ellipse__c.java b/src/gen/lib/common/ellipse__c.java index 5d1cb4708..52682e4d0 100644 --- a/src/gen/lib/common/ellipse__c.java +++ b/src/gen/lib/common/ellipse__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/common/emit__c.java b/src/gen/lib/common/emit__c.java index eda998b8e..88249d7b4 100644 --- a/src/gen/lib/common/emit__c.java +++ b/src/gen/lib/common/emit__c.java @@ -383,8 +383,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -1398,27 +1398,27 @@ public static void update_bb_bz(ST_boxf bb, ST_pointf.Array cp) { ENTERING("5wldemr88fdxl6101ugewclw9","update_bb_bz"); try { /* if any control point of the segment is outside the bounding box */ - if (cp.plus(0).getDouble("x") > bb.UR.x || cp.plus(0).getDouble("x") < bb.LL.x || - cp.plus(0).getDouble("y") > bb.UR.y || cp.plus(0).getDouble("y") < bb.LL.y || - cp.plus(1).getDouble("x") > bb.UR.x || cp.plus(1).getDouble("x") < bb.LL.x || - cp.plus(1).getDouble("y") > bb.UR.y || cp.plus(1).getDouble("y") < bb.LL.y || - cp.plus(2).getDouble("x") > bb.UR.x || cp.plus(2).getDouble("x") < bb.LL.x || - cp.plus(2).getDouble("y") > bb.UR.y || cp.plus(2).getDouble("y") < bb.LL.y || - cp.plus(3).getDouble("x") > bb.UR.x || cp.plus(3).getDouble("x") < bb.LL.x || - cp.plus(3).getDouble("y") > bb.UR.y || cp.plus(3).getDouble("y") < bb.LL.y) { + if (cp.get(0).x > bb.UR.x || cp.get(0).x < bb.LL.x || + cp.get(0).y > bb.UR.y || cp.get(0).y < bb.LL.y || + cp.get(1).x > bb.UR.x || cp.get(1).x < bb.LL.x || + cp.get(1).y > bb.UR.y || cp.get(1).y < bb.LL.y || + cp.get(2).x > bb.UR.x || cp.get(2).x < bb.LL.x || + cp.get(2).y > bb.UR.y || cp.get(2).y < bb.LL.y || + cp.get(3).x > bb.UR.x || cp.get(3).x < bb.LL.x || + cp.get(3).y > bb.UR.y || cp.get(3).y < bb.LL.y) { /* if the segment is sufficiently refined */ if (check_control_points(cp.asPtr())) { int i; /* expand the bounding box */ for (i = 0; i < 4; i++) { - if (cp.plus(i).getDouble("x") > bb.UR.x) - bb.UR.setDouble("x", cp.plus(i).getDouble("x")); - else if (cp.plus(i).getDouble("x") < bb.LL.x) - bb.LL.setDouble("x", cp.plus(i).getDouble("x")); - if (cp.plus(i).getDouble("y") > bb.UR.y) - bb.UR.setDouble("y", cp.plus(i).getDouble("y")); - else if (cp.plus(i).getDouble("y") < bb.LL.y) - bb.LL.setDouble("y", cp.plus(i).getDouble("y")); + if (cp.get(i).x > bb.UR.x) + bb.UR.setDouble("x", cp.get(i).x); + else if (cp.get(i).x < bb.LL.x) + bb.LL.setDouble("x", cp.get(i).x); + if (cp.get(i).y > bb.UR.y) + bb.UR.setDouble("y", cp.get(i).y); + else if (cp.get(i).y < bb.LL.y) + bb.LL.setDouble("y", cp.get(i).y); } } else { /* else refine the segment */ diff --git a/src/gen/lib/common/geom__c.java b/src/gen/lib/common/geom__c.java index c5cd004bd..bf5a7de06 100644 --- a/src/gen/lib/common/geom__c.java +++ b/src/gen/lib/common/geom__c.java @@ -138,8 +138,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -711,7 +711,7 @@ return cwrotatepf_w_(p.copy(), cwrot).copy(); private static ST_pointf cwrotatepf_w_(final ST_pointf p, int cwrot) { ENTERING("5q8h2tm3jifiasn423wrm0y60","cwrotatepf"); try { - double x = p.getDouble("x"), y = p.getDouble("y"); + double x = p.x, y = p.y; switch (cwrot) { case 0: break; @@ -789,7 +789,7 @@ return ccwrotatepf_w_(p.copy(), ccwrot).copy(); private static ST_pointf ccwrotatepf_w_(final ST_pointf p, int ccwrot) { ENTERING("6np74e9pfmv8uek8irqru2tma","ccwrotatepf"); try { - double x = p.getDouble("x"), y = p.getDouble("y"); + double x = p.x, y = p.y; switch (ccwrot) { case 0: break; @@ -880,9 +880,9 @@ return ptToLine2_w_(a.copy(), b.copy(), p.copy()); private static double ptToLine2_w_(final ST_pointf a, final ST_pointf b, final ST_pointf p) { ENTERING("90k9l4o3khu3dw0fzkrcd97nk","ptToLine2"); try { - double dx = b.getDouble("x")-a.getDouble("x"); - double dy = b.getDouble("y")-a.getDouble("y"); - double a2 = (p.getDouble("y")-a.getDouble("y"))*dx - (p.getDouble("x")-a.getDouble("x"))*dy; + double dx = b.x-a.x; + double dy = b.y-a.y; + double a2 = (p.y-a.y)*dx - (p.x-a.x)*dy; a2 *= a2; /* square - ensures that it is positive */ if (a2 < 0.0000000001) return 0.; /* avoid 0/0 problems */ return a2 / (dx*dx + dy*dy); diff --git a/src/gen/lib/common/globals__c.java b/src/gen/lib/common/globals__c.java index 3e87b7bd7..32b32635a 100644 --- a/src/gen/lib/common/globals__c.java +++ b/src/gen/lib/common/globals__c.java @@ -402,8 +402,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/common/htmllex__c.java b/src/gen/lib/common/htmllex__c.java index 35a57c3df..b3911a7d0 100644 --- a/src/gen/lib/common/htmllex__c.java +++ b/src/gen/lib/common/htmllex__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/common/htmlparse__c.java b/src/gen/lib/common/htmlparse__c.java index fbe6f0562..0f064c44b 100644 --- a/src/gen/lib/common/htmlparse__c.java +++ b/src/gen/lib/common/htmlparse__c.java @@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/common/htmltable__c.java b/src/gen/lib/common/htmltable__c.java index d751eb02b..7881482cd 100644 --- a/src/gen/lib/common/htmltable__c.java +++ b/src/gen/lib/common/htmltable__c.java @@ -376,8 +376,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/common/input__c.java b/src/gen/lib/common/input__c.java index 3ffad8b49..75bb0db0d 100644 --- a/src/gen/lib/common/input__c.java +++ b/src/gen/lib/common/input__c.java @@ -417,8 +417,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -1372,8 +1372,8 @@ UNSUPPORTED("dhhbmqv6n01j1eeyy7fpus1xw"); // xf = 0.02; GD_fontnames(g, maptoken(p, fontnamenames, fontnamecodes)); setRatio(g); GD_drawing(g).filled = - getdoubles2ptf(g, new CString("size"), (ST_pointf) GD_drawing(g).getStruct("size")); - getdoubles2ptf(g, new CString("page"), (ST_pointf) GD_drawing(g).getStruct("page")); + getdoubles2ptf(g, new CString("size"), (ST_pointf) GD_drawing(g).size); + getdoubles2ptf(g, new CString("page"), (ST_pointf) GD_drawing(g).page); GD_drawing(g).centered = mapbool(agget(g, new CString("center"))); if ((p = agget(g, new CString("rotate")))!=null) GD_drawing(g).landscape= (atoi(p) == 90); @@ -1540,7 +1540,7 @@ try { if ((str = agget(sg, new CString("label")))!=null && (str.charAt(0) != '\0')) { char pos_flag=0; final ST_pointf dimen = new ST_pointf(); - GD_has_labels(sg.getPtr("root"), GD_has_labels(sg.getPtr("root")) | (1 << 3)); + GD_has_labels(sg.root, GD_has_labels(sg.root) | (1 << 3)); GD_label(sg, make_label(sg, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)), late_double(sg, (agattr(sg,AGRAPH,new CString("fontsize"),null)), 14.0, 1.0), @@ -1574,8 +1574,8 @@ UNSUPPORTED("evu9w6pw3kkh7z8w7t4rx4qxc"); // pos_flag |= 4; /* Set border information for cluster labels to allow space */ dimen.___(GD_label(sg).dimen); - dimen.setDouble("x", dimen.getDouble("x") + 4*4); - dimen.setDouble("y", dimen.getDouble("y") + 2*4); + dimen.setDouble("x", dimen.x + 4*4); + dimen.setDouble("y", dimen.y + 2*4); if (N(GD_flip(agroot(sg)))) { if ((GD_label_pos(sg) & 1)!=0) pos_ix = 2; diff --git a/src/gen/lib/common/labels__c.java b/src/gen/lib/common/labels__c.java index cb06aea43..301eb8ffd 100644 --- a/src/gen/lib/common/labels__c.java +++ b/src/gen/lib/common/labels__c.java @@ -67,15 +67,16 @@ import static smetana.core.Macro.GD_label; import static smetana.core.Macro.MAX; import static smetana.core.Macro.N; import static smetana.core.Macro.UNSUPPORTED; -import static smetana.core.Macro.*; +import static smetana.core.Macro.ZALLOC_ST_textspan_t; import static smetana.core.Macro.agtail; import static smetana.core.Macro.hackInitDimensionFromLabel; import h.ST_Agedge_s; import h.ST_Agnode_s; -import h.ST_Agraph_s; -import h.ST_Agraphinfo_t; import h.ST_Agnodeinfo_t; import h.ST_Agobj_s; +import h.ST_Agraph_s; +import h.ST_Agraphinfo_t; +import h.ST_Agrec_s; import h.ST_GVC_s; import h.ST_pointf; import h.ST_port; @@ -411,8 +412,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -714,32 +715,32 @@ public static void storeline(ST_GVC_s gvc, ST_textlabel_t lp, CString line, char ENTERING("4wkeqik2dt7ecr64ej6ltbnvb","storeline"); try { final ST_pointf size = new ST_pointf(); - __ptr__ span = null; - int oldsz = lp.getInt("u.txt.nspans") + 1; - lp.setPtr("u.txt.span", ZALLOC_ST_textspan_t((ST_textspan_t.Array) lp.getPtr("u.txt.span"), oldsz + 1)); - span = lp.getPtr("u.txt.span").plus(lp.getInt("u.txt.nspans")); - span.setPtr("str", line); - span.setInt("just", terminator); + ST_textspan_t span = null; + int oldsz = lp.nspans + 1; + lp.span = ZALLOC_ST_textspan_t((ST_textspan_t.Array) lp.span, oldsz + 1); + span = lp.span.get(lp.nspans); + span.str = line; + span.just = terminator; if (line!=null && line.charAt(0)!='\0') { - Z.z().tf.setPtr("name", lp.getPtr("fontname")); - Z.z().tf.setDouble("size", lp.getDouble("fontsize")); + Z.z().tf.name = lp.fontname; + Z.z().tf.size = lp.fontsize; // WE CHEAT - ((ST_pointf) size).x = 0.0; - ((ST_pointf) size).y = (int)(lp.getDouble("fontsize") * 1.20); + size.x = 0.0; + size.y = (int)(lp.fontsize * 1.20); hackInitDimensionFromLabel(size, line.getContent()); - ((ST_pointf) span.getStruct("size")).y = (int)size.getDouble("y"); + span.size.y = (int)size.y; } else { System.err.println("YOU SHOULD NOT SEE THAT"); - ((ST_pointf) size).x = 0.0; - ((ST_pointf) size).y = (int)(lp.getDouble("fontsize") * 1.20); - span.getStruct("size").setDouble("y", (int)(lp.getDouble("fontsize") * 1.20)); + size.x = 0.0; + size.y = (int)(lp.fontsize * 1.20); + span.size.y = (int)(lp.fontsize * 1.20); } - lp.setInt("u.txt.nspans", lp.getInt("u.txt.nspans") + 1); + lp.nspans = lp.nspans + 1; /* width = max line width */ - ((ST_pointf) lp.dimen).x = MAX(lp.dimen.getDouble("x"), size.getDouble("x")); + lp.dimen.x = MAX(lp.dimen.x, size.x); /* accumulate height */ - ((ST_pointf) lp.dimen).y = lp.dimen.getDouble("y") + size.getDouble("y"); + lp.dimen.y = lp.dimen.y + size.y; } finally { LEAVING("4wkeqik2dt7ecr64ej6ltbnvb","storeline"); } @@ -772,7 +773,7 @@ try { * the second in 0x40-0x7e or 0xa1-0xfe. We assume that the input * is well-formed, but check that we don't go past the ending '\0'. */ - if ((lp.getInt("charset") == 2) && 0xA1 <= bytee && bytee <= 0xFE) { + if ((lp.charset == 2) && 0xA1 <= bytee && bytee <= 0xFE) { UNSUPPORTED("6la63t1mnqv30shyyp3yfroxb"); // *lineptr++ = c; UNSUPPORTED("ebmmarxykvf76hmfmjuk0ssjz"); // c = *p++; UNSUPPORTED("6la63t1mnqv30shyyp3yfroxb"); // *lineptr++ = c; @@ -834,7 +835,7 @@ try { switch (agobjkind(obj)) { case AGRAPH: sg = (ST_Agraph_s)obj; - g = (ST_Agraph_s) sg.getPtr("root"); + g = (ST_Agraph_s) sg.root; break; case AGNODE: n = (ST_Agnode_s)obj.castTo(ST_Agnode_s.class); @@ -848,7 +849,7 @@ try { rv.setPtr("fontname", fontname); rv.setPtr("fontcolor", fontcolor); rv.setDouble("fontsize", fontsize); - rv.setInt("charset", g.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agraphinfo_t.class).getInt("charset")); + rv.charset = ((ST_Agraphinfo_t)g.castTo_ST_Agobj_s().data.castTo(ST_Agraphinfo_t.class)).charset; if ((kind & (2 << 1))!=0) { rv.setPtr("text", str.strdup()); if ((kind & (1 << 1))!=0) { @@ -879,7 +880,7 @@ try { * sequences (\n, \l, \r) are processed in make_simple_label. That call also replaces \\ with \. */ rv.setPtr("text", strdup_and_subst_obj0(str, obj, 0)); - switch (rv.getInt("charset")) { + switch (rv.charset) { case 1: UNSUPPORTED("s = latin1ToUTF8(rv->text);"); break; @@ -887,9 +888,9 @@ try { s = htmlEntityUTF8(rv.text, g); break; } - Memory.free(rv.getPtr("text")); + Memory.free(rv.text); rv.setPtr("text", s); - make_simple_label((ST_GVC_s) g.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agraphinfo_t.class).getPtr("gvc"), rv); + make_simple_label(g.castTo_ST_Agobj_s().data.castTo_ST_Agraphinfo_t().gvc, rv); } return rv; } finally { @@ -1039,7 +1040,7 @@ try { g_len = strlen(g_str); n_str = agnameof(obj.castTo(ST_Agnode_s.class)); n_len = strlen(n_str); - tl = (ST_textlabel_t) obj.castTo(ST_Agnode_s.class).castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).getPtr("label"); + tl = (ST_textlabel_t) ((ST_Agnode_s)obj.castTo(ST_Agnode_s.class)).castTo_ST_Agobj_s().data.castTo_ST_Agnodeinfo_t().label; if (tl!=null) { l_str = tl.text; if (str!=null) l_len = strlen(l_str); diff --git a/src/gen/lib/common/ns__c.java b/src/gen/lib/common/ns__c.java index ca2c152b4..395db0d09 100644 --- a/src/gen/lib/common/ns__c.java +++ b/src/gen/lib/common/ns__c.java @@ -89,8 +89,8 @@ import static smetana.core.Macro.free_list; import h.ST_Agedge_s; import h.ST_Agnode_s; import h.ST_Agraph_s; -import h.ST_pointf; import h.ST_nodequeue; +import h.ST_pointf; import smetana.core.CString; import smetana.core.Memory; import smetana.core.Z; @@ -421,8 +421,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/common/output__c.java b/src/gen/lib/common/output__c.java index 8ef85e3ef..ea0815c1b 100644 --- a/src/gen/lib/common/output__c.java +++ b/src/gen/lib/common/output__c.java @@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/common/pointset__c.java b/src/gen/lib/common/pointset__c.java index ee6d3103b..bac8b100c 100644 --- a/src/gen/lib/common/pointset__c.java +++ b/src/gen/lib/common/pointset__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/common/postproc__c.java b/src/gen/lib/common/postproc__c.java index 319ba56ff..058098625 100644 --- a/src/gen/lib/common/postproc__c.java +++ b/src/gen/lib/common/postproc__c.java @@ -55,14 +55,12 @@ import static gen.lib.cgraph.node__c.agfstnode; import static gen.lib.cgraph.node__c.agnxtnode; import static gen.lib.cgraph.obj__c.agroot; import static gen.lib.common.geom__c.ccwrotatepf; -import static gen.lib.common.memory__c.zmalloc; import static gen.lib.common.splines__c.edgeMidpoint; import static gen.lib.common.splines__c.getsplinepoints; import static gen.lib.common.utils__c.late_bool; import static gen.lib.common.utils__c.updateBB; import static gen.lib.label.xlabels__c.placeLabels; import static smetana.core.JUtils.NEQ; -import static smetana.core.JUtils.sizeof; import static smetana.core.JUtilsDebug.ENTERING; import static smetana.core.JUtilsDebug.LEAVING; import static smetana.core.Macro.AGRAPH; @@ -90,7 +88,7 @@ import static smetana.core.Macro.ND_coord; import static smetana.core.Macro.ND_height; import static smetana.core.Macro.ND_width; import static smetana.core.Macro.ND_xlabel; -import static smetana.core.Macro.*; +import static smetana.core.Macro.NOTI; import static smetana.core.Macro.UNSUPPORTED; import h.ST_Agedge_s; import h.ST_Agnode_s; @@ -108,7 +106,6 @@ import h.ST_xlabel_t; import smetana.core.CString; import smetana.core.Memory; import smetana.core.Z; -import smetana.core.__ptr__; public class postproc__c { //1 2digov3edok6d5srhgtlmrycs @@ -434,8 +431,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -752,8 +749,8 @@ private static ST_pointf map_point_w_(final ST_pointf p) { ENTERING("dajapw16wus3rwimkrk5ihi2b","map_point"); try { p.___(ccwrotatepf(p, Z.z().Rankdir * 90)); - p.setDouble("x", p.getDouble("x") - Z.z().Offset.getDouble("x")); - p.setDouble("y", p.getDouble("y") - Z.z().Offset.getDouble("y")); + p.setDouble("x", p.x - Z.z().Offset.x); + p.setDouble("y", p.y - Z.z().Offset.y); return p; } finally { LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point"); @@ -784,18 +781,18 @@ try { if (bz.sflag!=0) UNSUPPORTED("7894dgzvk2um2w1a5ph2r0bcc"); // ED_spl(e)->list[j].sp = map_point(ED_spl(e)->list[j].sp); if (bz.eflag!=0) { - ED_spl(e).list.plus(j).getStruct("ep").___(map_point((ST_pointf) ED_spl(e).list.plus(j).getStruct("ep"))); + ED_spl(e).list.get(j).ep.___(map_point((ST_pointf) ED_spl(e).list.get(j).ep)); } } if (ED_label(e)!=null) - ED_label(e).getStruct("pos").___(map_point((ST_pointf) ED_label(e).getStruct("pos"))); + ED_label(e).pos.___(map_point((ST_pointf) ED_label(e).pos)); if (ED_xlabel(e)!=null) UNSUPPORTED("al3tnq9zjjqeq1ll7qdxyu3ja"); // ED_xlabel(e)->pos = map_point(ED_xlabel(e)->pos); /* vladimir */ if (ED_head_label(e)!=null) - ED_head_label(e).setStruct("pos", map_point((ST_pointf) ED_head_label(e).getStruct("pos"))); + ED_head_label(e).setStruct("pos", map_point((ST_pointf) ED_head_label(e).pos)); if (ED_tail_label(e)!=null) - ED_tail_label(e).setStruct("pos", map_point((ST_pointf) ED_tail_label(e).getStruct("pos"))); + ED_tail_label(e).setStruct("pos", map_point((ST_pointf) ED_tail_label(e).pos)); } finally { LEAVING("bvq3vvonvotn47mfe5zsvchie","map_edge"); } @@ -821,10 +818,10 @@ UNSUPPORTED("crysiae5zxc69cj3v2ygfs8xn"); // new_bb.UR = map_point(pointfof(bb. } GD_bb(g).___(new_bb); if (GD_label(g)!=null) { - GD_label(g).setStruct("pos", map_point((ST_pointf) GD_label(g).getStruct("pos"))); + GD_label(g).setStruct("pos", map_point((ST_pointf) GD_label(g).pos)); } for (c = 1; c <= GD_n_cluster(g); c++) - translate_bb((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(), rankdir); + translate_bb((ST_Agraph_s) GD_clust(g).get(c).getPtr(), rankdir); } finally { LEAVING("a3hf82rxsojxbunj6p8a6bkse","translate_bb"); } @@ -840,7 +837,7 @@ ENTERING("h4i5qxnd7hlrew919abswd13","translate_drawing"); try { ST_Agnode_s v; ST_Agedge_s e; - boolean shift = (Z.z().Offset.getDouble("x")!=0.0 || Z.z().Offset.getDouble("y")!=0.0); + boolean shift = (Z.z().Offset.x!=0.0 || Z.z().Offset.y!=0.0); if (N(shift) && N(Z.z().Rankdir)) return; for (v = agfstnode(g); v!=null; v = agnxtnode(g, v)) { @@ -892,13 +889,13 @@ throw new UnsupportedOperationException(); //3 2i713kmewjct2igf3lwm80462 // static pointf centerPt (xlabel_t* xlp) -public static ST_pointf centerPt(__ptr__ /*ST_xlabel_t*/ xlp) { +public static ST_pointf centerPt(ST_xlabel_t.Array xlp) { ENTERING("2i713kmewjct2igf3lwm80462","centerPt"); try { final ST_pointf p = new ST_pointf(); - p.___(xlp.getStruct("pos")); - p.setDouble("x", p.getDouble("x") + xlp.getStruct("sz").getDouble("x")/2); - p.setDouble("y", p.getDouble("y") + xlp.getStruct("sz").getDouble("y")/2); + p.___(xlp.getStruct().pos); + p.setDouble("x", p.x + xlp.getStruct().sz.x/2); + p.setDouble("y", p.y + xlp.getStruct().sz.y/2); return p; } finally { LEAVING("2i713kmewjct2igf3lwm80462","centerPt"); @@ -962,10 +959,10 @@ UNSUPPORTED("9wdrv4uc4c7ssn0qpmxgz5eu1"); // pointf p; UNSUPPORTED("ezy0ey6dn5uqp6peuorn615x6"); // p.x = p.y = 0; UNSUPPORTED("68kasxgknec72r19lohbk6n3q"); // return p; } - bez = spl.list.plus(0).getPtr(); + bez = spl.list.get(0); // bez = &spl->list[0]; if (bez.sflag!=0) { - return (ST_pointf) bez.getStruct("sp"); + return (ST_pointf) bez.sp; } else { return (ST_pointf) (bez.getPtr()).list.get(0); // return bez->list[0]; @@ -1010,7 +1007,7 @@ if (bez.eflag!=0) { //3 1ca6fh8ns5bgzfzcz8al4eh4k // static boxf adjustBB (object_t* objp, boxf bb) -public static ST_boxf adjustBB(__ptr__ objp, ST_boxf bb) { +public static ST_boxf adjustBB(ST_object_t.Array objp, ST_boxf bb) { ENTERING("1ca6fh8ns5bgzfzcz8al4eh4k","adjustBB"); try { return adjustBB_(objp, bb.copy()).copy(); @@ -1018,15 +1015,15 @@ try { LEAVING("1ca6fh8ns5bgzfzcz8al4eh4k","adjustBB"); } } -private static ST_boxf adjustBB_(__ptr__ objp, ST_boxf bb) { +private static ST_boxf adjustBB_(ST_object_t.Array objp, ST_boxf bb) { final ST_pointf ur = new ST_pointf(); /* Adjust bounding box */ - bb.LL.setDouble("x", MIN(bb.LL.x, objp.getPtr("pos").getDouble("x"))); - bb.LL.setDouble("y", MIN(bb.LL.y, objp.getPtr("pos").getDouble("y"))); - ur.setDouble("x", objp.getPtr("pos").getDouble("x") + objp.getPtr("sz").getDouble("x")); - ur.setDouble("y", objp.getPtr("pos").getDouble("y") + objp.getPtr("sz").getDouble("y")); - bb.UR.setDouble("x", MAX(bb.UR.x, ur.getDouble("x"))); - bb.UR.setDouble("y", MAX(bb.UR.y, ur.getDouble("y"))); + bb.LL.setDouble("x", MIN(bb.LL.x, objp.getStruct().pos.x)); + bb.LL.setDouble("y", MIN(bb.LL.y, objp.getStruct().pos.y)); + ur.setDouble("x", objp.getStruct().pos.x + objp.getStruct().sz.x); + ur.setDouble("y", objp.getStruct().pos.y + objp.getStruct().sz.y); + bb.UR.setDouble("x", MAX(bb.UR.x, ur.x)); + bb.UR.setDouble("y", MAX(bb.UR.y, ur.y)); return bb; } @@ -1035,7 +1032,7 @@ private static ST_boxf adjustBB_(__ptr__ objp, ST_boxf bb) { //3 3mefe722uemyoa0czmkkw6hjb // static void addXLabel (textlabel_t* lp, object_t* objp, xlabel_t* xlp, int initObj, pointf pos) -public static void addXLabel(ST_textlabel_t lp, __ptr__ objp, ST_xlabel_t.Array xlp, int initObj, ST_pointf pos) { +public static void addXLabel(ST_textlabel_t lp, ST_object_t.Array objp, ST_xlabel_t.Array xlp, int initObj, ST_pointf pos) { ENTERING("3mefe722uemyoa0czmkkw6hjb","addXLabel"); try { addXLabel_(lp, objp, xlp, initObj, pos.copy()); @@ -1043,10 +1040,10 @@ try { LEAVING("3mefe722uemyoa0czmkkw6hjb","addXLabel"); } } -private static void addXLabel_(ST_textlabel_t lp, __ptr__ objp, ST_xlabel_t.Array xlp, int initObj, ST_pointf pos) { +private static void addXLabel_(ST_textlabel_t lp, ST_object_t.Array objp, ST_xlabel_t.Array xlp, int initObj, ST_pointf pos) { if (initObj!=0) { - objp.getStruct("sz").setDouble("x", 0); - objp.getStruct("sz").setDouble("y", 0); + objp.getStruct().sz.setDouble("x", 0); + objp.getStruct().sz.setDouble("y", 0); objp.setStruct("pos", pos); } if (Z.z().Flip) { @@ -1066,11 +1063,11 @@ objp.setPtr("lbl", xlp); //3 dwxd5kvlanbcxqfuncjg0ea54 // static boxf addLabelObj (textlabel_t* lp, object_t* objp, boxf bb) -public static ST_boxf addLabelObj(ST_textlabel_t lp, __ptr__ objp, final ST_boxf bb) { +public static ST_boxf addLabelObj(ST_textlabel_t lp, ST_object_t.Array objp, final ST_boxf bb) { // WARNING!! STRUCT return addLabelObj_(lp, objp, bb.copy()).copy(); } -private static ST_boxf addLabelObj_(ST_textlabel_t lp, __ptr__ objp, final ST_boxf bb) { +private static ST_boxf addLabelObj_(ST_textlabel_t lp, ST_object_t.Array objp, final ST_boxf bb) { ENTERING("dwxd5kvlanbcxqfuncjg0ea54","addLabelObj"); try { if (Z.z().Flip) { @@ -1078,12 +1075,12 @@ UNSUPPORTED("6z2yrwq81gtsk3q9c5pofow1x"); // objp->sz.x = lp->dimen.y; UNSUPPORTED("8xsm9kavrekjrsydqe1wh1pu"); // objp->sz.y = lp->dimen.x; } else { - objp.getPtr("sz").setDouble("x", lp.dimen.getDouble("x")); - objp.getPtr("sz").setDouble("y", lp.dimen.getDouble("y")); + objp.getStruct().sz.setDouble("x", lp.dimen.x); + objp.getStruct().sz.setDouble("y", lp.dimen.y); } - objp.setStruct("pos", lp.getStruct("pos")); - objp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x") - (objp.getStruct("sz").getDouble("x") / 2.0 )); - objp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") - (objp.getStruct("sz").getDouble("y") / 2.0 )); + objp.setStruct("pos", lp.pos); + objp.getStruct().pos.setDouble("x", objp.getStruct().pos.x - (objp.getStruct().sz.x / 2.0 )); + objp.getStruct().pos.setDouble("y", objp.getStruct().pos.y - (objp.getStruct().sz.y / 2.0 )); return adjustBB(objp, bb); } finally { LEAVING("dwxd5kvlanbcxqfuncjg0ea54","addLabelObj"); @@ -1095,11 +1092,11 @@ UNSUPPORTED("8xsm9kavrekjrsydqe1wh1pu"); // objp->sz.y = lp->dimen.x; //3 b8tjygxnwny5qoiir1mha1d62 // static boxf addNodeObj (node_t* np, object_t* objp, boxf bb) -public static ST_boxf addNodeObj(ST_Agnode_s np, __ptr__ objp, final ST_boxf bb) { +public static ST_boxf addNodeObj(ST_Agnode_s np, ST_object_t.Array objp, final ST_boxf bb) { // WARNING!! STRUCT return addNodeObj_(np, objp, bb.copy()).copy(); } -public static ST_boxf addNodeObj_(ST_Agnode_s np, __ptr__ objp, final ST_boxf bb) { +public static ST_boxf addNodeObj_(ST_Agnode_s np, ST_object_t.Array objp, final ST_boxf bb) { ENTERING("b8tjygxnwny5qoiir1mha1d62","map_point"); try { if (Z.z().Flip) { @@ -1107,12 +1104,12 @@ try { UNSUPPORTED("6r5gwwhz3sjxrssh8yo3v5c3v"); // objp->sz.y = ((ND_width(np))*(double)72); } else { - objp.getPtr("sz").setDouble("x", ((ND_width(np))*(double)72)); - objp.getPtr("sz").setDouble("y", ((ND_height(np))*(double)72)); + objp.getStruct().sz.setDouble("x", ((ND_width(np))*(double)72)); + objp.getStruct().sz.setDouble("y", ((ND_height(np))*(double)72)); } objp.setPtr("pos", ND_coord(np)); - objp.getPtr("pos").setDouble("x", objp.getPtr("pos").getDouble("x") - objp.getPtr("sz").getDouble("x") / 2.0); - objp.getPtr("pos").setDouble("y", objp.getPtr("pos").getDouble("y") - objp.getPtr("sz").getDouble("y") / 2.0); + objp.getStruct().pos.setDouble("x", objp.getStruct().pos.x - objp.getStruct().sz.x / 2.0); + objp.getStruct().pos.setDouble("y", objp.getStruct().pos.y - objp.getStruct().sz.y / 2.0); return adjustBB(objp, bb); } finally { LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point"); @@ -1135,11 +1132,11 @@ LEAVING("6kx3lin2ig9o2otk2bqzdvd4t","addClusterObj"); private static ST_cinfo_t addClusterObj_(ST_Agraph_s g, ST_cinfo_t info) { int c; for (c = 1; c <= GD_n_cluster(g); c++) - info.___(addClusterObj ((ST_Agraph_s)GD_clust(g).plus(c).getPtr().castTo(ST_Agraph_s.class), info)); + info.___(addClusterObj ((ST_Agraph_s)GD_clust(g).get(c).castTo(ST_Agraph_s.class), info)); if (NEQ(g, agroot(g)) && (GD_label(g)!=null) && GD_label(g).set!=0) { - __ptr__ objp = info.getPtr("objp"); + ST_object_t.Array objp = info.objp; info.setStruct("bb", addLabelObj (GD_label(g), objp, (ST_boxf) info.bb)); - info.setPtr("objp", info.getPtr("objp").plus(1)); + info.objp = info.objp.plus(1); //UNSUPPORTED("dcgq2zlh4t0m1gno12t6h7ouy"); // object_t* objp = info.objp; //UNSUPPORTED("ddz79zm5235krd6smukq1gza0"); // info.bb = addLabelObj (GD_label(g), objp, info.bb); //UNSUPPORTED("be25qc3x3muxo4l87ji01t3kd"); // info.objp++; @@ -1331,7 +1328,7 @@ UNSUPPORTED("cls7z8l7wi371a4wrec0viqil"); // objp++; if (n_clbls!=0) { final ST_cinfo_t info = new ST_cinfo_t(); info.setStruct("bb", bb); - info.setPtr("objp", objp); + info.objp = objp; info.___(addClusterObj (gp, info)); bb.___(info.bb); } @@ -1346,7 +1343,7 @@ placeLabels(objs, n_objs, lbls, n_lbls, params); for (i = 0; i < n_lbls; i++) { if (xlp.get(0).set!=0) { cnt++; - lp = (ST_textlabel_t) /*(textlabel_t *)*/ (xlp.getPtr("lbl")); + lp = xlp.getStruct().lbl; lp.setInt("set", 1); lp.setStruct("pos", centerPt(xlp)); updateBB (gp, lp); @@ -1386,7 +1383,7 @@ UNSUPPORTED("4hxky2sp978rmy6018sfmts6m"); // place_flip_graph_label(g); */ addXLabels(g); /* Add space for graph label if necessary */ - if (GD_label(g)!=null && N(GD_label(g).getPtr("set"))) { + if (GD_label(g)!=null && N(GD_label(g).set)) { UNSUPPORTED("crj0py2wme4b5l8apvbxqcmqa"); // dimen = GD_label(g)->dimen; UNSUPPORTED("22jhn709g4c5wh0gb6v40rh19"); // {((dimen).x += 4*4); ((dimen).y += 2*4);}; UNSUPPORTED("9k69y89jybam5elefg45va3ey"); // if (Flip) { @@ -1438,7 +1435,7 @@ UNSUPPORTED("3xtu7zkpqq7nsx9oe68oi6ebt"); // Offset = pointfof(GD_bb(g).LL. } translate_drawing(g); } - if (GD_label(g)!=null && N(GD_label(g).getPtr("set"))) + if (GD_label(g)!=null && N(GD_label(g).set)) UNSUPPORTED("6dds0zsvqw48u510zcy954fh1"); // place_root_label(g, dimen); if (Z.z().Show_boxes!=null) { UNSUPPORTED("8c7x8di5w36ib05qan9z4sl9"); // char buf[BUFSIZ]; @@ -1513,10 +1510,10 @@ ENTERING("72zw1alhd5vd0g6mhum507rvx","place_graph_label"); try { int c; final ST_pointf p = new ST_pointf(), d = new ST_pointf(); - if (NEQ(g, agroot(g)) && (GD_label(g)!=null) && N(GD_label(g).getInt("set"))) { + if (NEQ(g, agroot(g)) && (GD_label(g)!=null) && N(GD_label(g).set)) { if ((GD_label_pos(g) & 1)!=0) { d.___(GD_border(g)[2].getStruct()); - p.setDouble("y", GD_bb(g).UR.y - d.getDouble("y") / 2); + p.setDouble("y", GD_bb(g).UR.y - d.y / 2); } else { UNSUPPORTED("1w38no4welthbwa0i10hei16b"); // d = GD_border(g)[0]; UNSUPPORTED("2xa4n9ca16xpf1kahaycmkl4r"); // p.y = GD_bb(g).LL.y + d.y / 2; @@ -1532,7 +1529,7 @@ UNSUPPORTED("7ictv9eqmjvxjii5lqlyw8nu"); // p.x = GD_bb(g).LL.x + d.x / 2; GD_label(g).set= NOTI(false); } for (c = 1; c <= GD_n_cluster(g); c++) - place_graph_label((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); + place_graph_label((ST_Agraph_s) GD_clust(g).get(c).getPtr()); } finally { LEAVING("72zw1alhd5vd0g6mhum507rvx","place_graph_label"); } diff --git a/src/gen/lib/common/psusershape__c.java b/src/gen/lib/common/psusershape__c.java index 2174e0637..deb6a9fed 100644 --- a/src/gen/lib/common/psusershape__c.java +++ b/src/gen/lib/common/psusershape__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/common/routespl__c.java b/src/gen/lib/common/routespl__c.java index d922ea1de..9ed4acbac 100644 --- a/src/gen/lib/common/routespl__c.java +++ b/src/gen/lib/common/routespl__c.java @@ -399,8 +399,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -740,10 +740,10 @@ try { final ST_pointf.Array eps = new ST_pointf.Array( 2); final ST_pointf.Array evs = new ST_pointf.Array( 2); int i; - eps.plus(0).setDouble("x", tp.getDouble("x")); - eps.plus(0).setDouble("y", tp.getDouble("y")); - eps.plus(1).setDouble("x", hp.getDouble("x")); - eps.plus(1).setDouble("y", hp.getDouble("y")); + eps.plus(0).setDouble("x", tp.x); + eps.plus(0).setDouble("y", tp.y); + eps.plus(1).setDouble("x", hp.x); + eps.plus(1).setDouble("y", hp.y); if (Pshortestpath(poly, eps, pl) < 0) return null; if (polyline) @@ -838,26 +838,26 @@ try { sp.plus(1).getStruct().___(pps.plus(splinepi+1).getStruct()); sp.plus(2).getStruct().___(pps.plus(splinepi+2).getStruct()); sp.plus(3).getStruct().___(pps.plus(splinepi+3).getStruct()); - sp.plus(0).setDouble("x", sp.plus(0).getDouble("x") + t * (sp.plus(1).getDouble("x") - sp.plus(0).getDouble("x"))); - sp.plus(0).setDouble("y", sp.plus(0).getDouble("y") + t * (sp.plus(1).getDouble("y") - sp.plus(0).getDouble("y"))); - sp.plus(1).setDouble("x", sp.plus(1).getDouble("x") + t * (sp.plus(2).getDouble("x") - sp.plus(1).getDouble("x"))); - sp.plus(1).setDouble("y", sp.plus(1).getDouble("y") + t * (sp.plus(2).getDouble("y") - sp.plus(1).getDouble("y"))); - sp.plus(2).setDouble("x", sp.plus(2).getDouble("x") + t * (sp.plus(3).getDouble("x") - sp.plus(2).getDouble("x"))); - sp.plus(2).setDouble("y", sp.plus(2).getDouble("y") + t * (sp.plus(3).getDouble("y") - sp.plus(2).getDouble("y"))); - sp.plus(0).setDouble("x", sp.plus(0).getDouble("x") + t * (sp.plus(1).getDouble("x") - sp.plus(0).getDouble("x"))); - sp.plus(0).setDouble("y", sp.plus(0).getDouble("y") + t * (sp.plus(1).getDouble("y") - sp.plus(0).getDouble("y"))); - sp.plus(1).setDouble("x", sp.plus(1).getDouble("x") + t * (sp.plus(2).getDouble("x") - sp.plus(1).getDouble("x"))); - sp.plus(1).setDouble("y", sp.plus(1).getDouble("y") + t * (sp.plus(2).getDouble("y") - sp.plus(1).getDouble("y"))); - sp.plus(0).setDouble("x", sp.plus(0).getDouble("x") + t * (sp.plus(1).getDouble("x") - sp.plus(0).getDouble("x"))); - sp.plus(0).setDouble("y", sp.plus(0).getDouble("y") + t * (sp.plus(1).getDouble("y") - sp.plus(0).getDouble("y"))); + sp.plus(0).setDouble("x", sp.get(0).x + t * (sp.get(1).x - sp.get(0).x)); + sp.plus(0).setDouble("y", sp.get(0).y + t * (sp.get(1).y - sp.get(0).y)); + sp.plus(1).setDouble("x", sp.get(1).x + t * (sp.get(2).x - sp.get(1).x)); + sp.plus(1).setDouble("y", sp.get(1).y + t * (sp.get(2).y - sp.get(1).y)); + sp.plus(2).setDouble("x", sp.get(2).x + t * (sp.get(3).x - sp.get(2).x)); + sp.plus(2).setDouble("y", sp.get(2).y + t * (sp.get(3).y - sp.get(2).y)); + sp.plus(0).setDouble("x", sp.get(0).x + t * (sp.get(1).x - sp.get(0).x)); + sp.plus(0).setDouble("y", sp.get(0).y + t * (sp.get(1).y - sp.get(0).y)); + sp.plus(1).setDouble("x", sp.get(1).x + t * (sp.get(2).x - sp.get(1).x)); + sp.plus(1).setDouble("y", sp.get(1).y + t * (sp.get(2).y - sp.get(1).y)); + sp.plus(0).setDouble("x", sp.get(0).x + t * (sp.get(1).x - sp.get(0).x)); + sp.plus(0).setDouble("y", sp.get(0).y + t * (sp.get(1).y - sp.get(0).y)); for (bi = 0; bi < boxn; bi++) { /* this tested ok on 64bit machines, but on 32bit we need this FUDGE * or graphs/directed/records.gv fails */ - if (sp.plus(0).getDouble("y") <= boxes[bi].UR.y+.0001 && sp.plus(0).getDouble("y") >= boxes[bi].LL.y-.0001) { - if (boxes[bi].LL.x > sp.plus(0).getDouble("x")) - boxes[bi].LL.setDouble("x", sp.plus(0).getDouble("x")); - if (boxes[bi].UR.x < sp.plus(0).getDouble("x")) - boxes[bi].UR.setDouble("x", sp.plus(0).getDouble("x")); + if (sp.get(0).y <= boxes[bi].UR.y+.0001 && sp.get(0).y >= boxes[bi].LL.y-.0001) { + if (boxes[bi].LL.x > sp.get(0).x) + boxes[bi].LL.setDouble("x", sp.get(0).x); + if (boxes[bi].UR.x < sp.get(0).x) + boxes[bi].UR.setDouble("x", sp.get(0).x); } } } @@ -889,7 +889,7 @@ try { int loopcnt, delta = 10; boolean unbounded; Z.z().nedges++; - Z.z().nboxes += pp.getInt("nbox"); + Z.z().nboxes += pp.nbox; for (realedge = (ST_Agedge_s) pp.data.castTo(ST_Agedge_s.class); realedge!=null && ED_edge_type(realedge) != 0; realedge = ED_to_orig(realedge)); @@ -898,7 +898,7 @@ try { return null; } boxes = pp.boxes; - boxn = pp.getInt("nbox"); + boxn = pp.nbox; if (checkpath(boxn, boxes, pp)!=0) return null; if (boxn * 8 > Z.z().polypointn) { @@ -1003,7 +1003,7 @@ UNSUPPORTED("11hwqop4xebvtcskop4uhpp01"); // return NULL; ((ST_boxf)boxes[bi]).LL.y = -v; } for (i = 0; i < pi; i++) - Z.z().polypoints.plus(i).setDouble("y", -1 * Z.z().polypoints.plus(i).getDouble("y")); + Z.z().polypoints.plus(i).setDouble("y", -1 * Z.z().polypoints.get(i).y); } for (bi = 0; bi < boxn; bi++) { ((ST_boxf)boxes[bi]).LL.x = INT_MAX; @@ -1011,10 +1011,10 @@ UNSUPPORTED("11hwqop4xebvtcskop4uhpp01"); // return NULL; } poly.ps = Z.z().polypoints; poly.pn = pi; - eps.plus(0).getStruct().setDouble("x", pp.start.getStruct("p").getDouble("x")); - eps.plus(0).getStruct().setDouble("y", pp.start.getStruct("p").getDouble("y")); - eps.plus(1).getStruct().setDouble("x", pp.getStruct("end").getStruct("p").getDouble("x")); - eps.plus(1).getStruct().setDouble("y", pp.getStruct("end").getStruct("p").getDouble("y")); + eps.plus(0).getStruct().setDouble("x", pp.start.p.x); + eps.plus(0).getStruct().setDouble("y", pp.start.p.y); + eps.plus(1).getStruct().setDouble("x", pp.end.p.x); + eps.plus(1).getStruct().setDouble("y", pp.end.p.y); if (Pshortestpath(poly, eps, pl) < 0) { System.err.println("in routesplines, Pshortestpath failed\n"); return null; @@ -1032,16 +1032,16 @@ UNSUPPORTED("48veztc3k9dfw8tqolu7jsktk"); // make_polyline (pl, &spl); Z.z().edges.plus(edgei).setStruct("b", Z.z().polypoints.plus((edgei + 1) % poly.pn).getStruct()); } if (pp.start.constrained!=0) { - evs.plus(0).getStruct().setDouble("x", cos(pp.start.getDouble("theta"))); - evs.plus(0).getStruct().setDouble("y", sin(pp.start.getDouble("theta"))); + evs.plus(0).getStruct().setDouble("x", cos(pp.start.theta)); + evs.plus(0).getStruct().setDouble("y", sin(pp.start.theta)); } else { evs.plus(0).getStruct().setDouble("x", 0); evs.plus(0).getStruct().setDouble("y", 0); } if (pp.end.constrained!=0) { - evs.plus(1).getStruct().setDouble("x", -cos(pp.getStruct("end").getDouble("theta"))); - evs.plus(1).getStruct().setDouble("y", -sin(pp.getStruct("end").getDouble("theta"))); + evs.plus(1).getStruct().setDouble("x", -cos(pp.end.theta)); + evs.plus(1).getStruct().setDouble("y", -sin(pp.end.theta)); } else { evs.plus(1).getStruct().setDouble("x", 0); @@ -1091,8 +1091,8 @@ UNSUPPORTED("7x5kpcbvg4va887hky7ufm45y"); // return NULL; /* Bailout if no mem final ST_Ppoly_t polyspl = new ST_Ppoly_t(); System.err.println("Unable to reclaim box space in spline routing for edge \"%s\" -> \"%s\". Something is probably seriously wrong.\n"); make_polyline (pl, polyspl); - limitBoxes (boxes, boxn, polyspl.getPtr("ps"), polyspl.pn, 10); - Memory.free (polyspl.getPtr("ps")); + limitBoxes (boxes, boxn, polyspl.ps, polyspl.pn, 10); + Memory.free (polyspl.ps); } npoints[0] = spl.pn; return Z.z().ps; @@ -1279,39 +1279,39 @@ UNSUPPORTED("5r6ck8hfb1cxywn9go61se9kx"); // ba.LL.x = bb.UR.x; } } } - if (thepath.start.getStruct("p").getDouble("x") < ((ST_boxf)boxes[0]).LL.x - || thepath.start.getStruct("p").getDouble("x") > ((ST_boxf)boxes[0]).UR.x - || thepath.start.getStruct("p").getDouble("y") < ((ST_boxf)boxes[0]).LL.y - || thepath.start.getStruct("p").getDouble("y") > ((ST_boxf)boxes[0]).UR.y) { + if (thepath.start.p.x < ((ST_boxf)boxes[0]).LL.x + || thepath.start.p.x > ((ST_boxf)boxes[0]).UR.x + || thepath.start.p.y < ((ST_boxf)boxes[0]).LL.y + || thepath.start.p.y > ((ST_boxf)boxes[0]).UR.y) { /*if (Verbose) { fprintf(stderr, "in checkpath, start port not in first box\n"); printpath(thepath); }*/ - if (thepath.start.getStruct("p").getDouble("x") < ((ST_boxf)boxes[0]).LL.x) - thepath.start.getStruct("p").setDouble("x", ((ST_boxf)boxes[0]).LL.x); - if (thepath.start.getStruct("p").getDouble("x") > ((ST_boxf)boxes[0]).UR.x) - thepath.start.getStruct("p").setDouble("x", ((ST_boxf)boxes[0]).UR.x); - if (thepath.start.getStruct("p").getDouble("y") < ((ST_boxf)boxes[0]).LL.y) - thepath.start.getStruct("p").setDouble("y", ((ST_boxf)boxes[0]).LL.y); - if (thepath.start.getStruct("p").getDouble("y") > ((ST_boxf)boxes[0]).UR.y) - thepath.start.getStruct("p").setDouble("y", ((ST_boxf)boxes[0]).UR.y); + if (thepath.start.p.x < ((ST_boxf)boxes[0]).LL.x) + thepath.start.p.setDouble("x", ((ST_boxf)boxes[0]).LL.x); + if (thepath.start.p.x > ((ST_boxf)boxes[0]).UR.x) + thepath.start.p.setDouble("x", ((ST_boxf)boxes[0]).UR.x); + if (thepath.start.p.y < ((ST_boxf)boxes[0]).LL.y) + thepath.start.p.setDouble("y", ((ST_boxf)boxes[0]).LL.y); + if (thepath.start.p.y > ((ST_boxf)boxes[0]).UR.y) + thepath.start.p.setDouble("y", ((ST_boxf)boxes[0]).UR.y); } - if (thepath.getStruct("end").getStruct("p").getDouble("x") < ((ST_boxf)boxes[boxn - 1]).LL.x - || thepath.getStruct("end").getStruct("p").getDouble("x") > ((ST_boxf)boxes[boxn - 1]).UR.x - || thepath.getStruct("end").getStruct("p").getDouble("y") < ((ST_boxf)boxes[boxn - 1]).LL.y - || thepath.getStruct("end").getStruct("p").getDouble("y") > ((ST_boxf)boxes[boxn - 1]).UR.y) { + if (thepath.end.p.x < ((ST_boxf)boxes[boxn - 1]).LL.x + || thepath.end.p.x > ((ST_boxf)boxes[boxn - 1]).UR.x + || thepath.end.p.y < ((ST_boxf)boxes[boxn - 1]).LL.y + || thepath.end.p.y > ((ST_boxf)boxes[boxn - 1]).UR.y) { /*if (Verbose) { fprintf(stderr, "in checkpath, end port not in last box\n"); printpath(thepath); }*/ - if (thepath.getStruct("end").getStruct("p").getDouble("x") < ((ST_boxf)boxes[boxn - 1]).LL.x) - thepath.getStruct("end").getStruct("p").setDouble("x", ((ST_boxf)boxes[boxn - 1]).LL.x); - if (thepath.getStruct("end").getStruct("p").getDouble("x") > ((ST_boxf)boxes[boxn - 1]).UR.x) - thepath.getStruct("end").getStruct("p").setDouble("x", ((ST_boxf)boxes[boxn - 1]).UR.x); - if (thepath.getStruct("end").getStruct("p").getDouble("y") < ((ST_boxf)boxes[boxn - 1]).LL.y) - thepath.getStruct("end").getStruct("p").setDouble("y", ((ST_boxf)boxes[boxn - 1]).LL.y); - if (thepath.getStruct("end").getStruct("p").getDouble("y") > ((ST_boxf)boxes[boxn - 1]).UR.y) - thepath.getStruct("end").getStruct("p").setDouble("y", ((ST_boxf)boxes[boxn - 1]).UR.y); + if (thepath.end.p.x < ((ST_boxf)boxes[boxn - 1]).LL.x) + thepath.end.p.setDouble("x", ((ST_boxf)boxes[boxn - 1]).LL.x); + if (thepath.end.p.x > ((ST_boxf)boxes[boxn - 1]).UR.x) + thepath.end.p.setDouble("x", ((ST_boxf)boxes[boxn - 1]).UR.x); + if (thepath.end.p.y < ((ST_boxf)boxes[boxn - 1]).LL.y) + thepath.end.p.setDouble("y", ((ST_boxf)boxes[boxn - 1]).LL.y); + if (thepath.end.p.y > ((ST_boxf)boxes[boxn - 1]).UR.y) + thepath.end.p.setDouble("y", ((ST_boxf)boxes[boxn - 1]).UR.y); } return 0; } finally { diff --git a/src/gen/lib/common/shapes__c.java b/src/gen/lib/common/shapes__c.java index a74a64600..88883ddbd 100644 --- a/src/gen/lib/common/shapes__c.java +++ b/src/gen/lib/common/shapes__c.java @@ -86,9 +86,9 @@ import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.fabs; import static smetana.core.Macro.hypot; import h.ST_Agnode_s; -import h.ST_Agraphinfo_t; import h.ST_Agnodeinfo_t; import h.ST_Agobj_s; +import h.ST_Agraphinfo_t; import h.ST_boxf; import h.ST_inside_t; import h.ST_point; @@ -426,8 +426,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -724,8 +724,8 @@ throw new UnsupportedOperationException(); // static port Center = /*private final static __struct__ Center = JUtils.from(port.class); static { -Center.getStruct("p").setDouble("x", 0); -Center.getStruct("p").setDouble("y", 0); +Center.p.setDouble("x", 0); +Center.p.setDouble("y", 0); Center.setDouble("theta", -1); Center.setPtr("bp", null); Center.setInt("defined", 0); @@ -1057,11 +1057,11 @@ try { boolean s0, s1; double a, b, c; /* a x + b y = c */ - a = -(L1.getDouble("y") - L0.getDouble("y")); - b = (L1.getDouble("x") - L0.getDouble("x")); - c = a * L0.getDouble("x") + b * L0.getDouble("y"); - s0 = (a * p0.getDouble("x") + b * p0.getDouble("y") - c >= 0); - s1 = (a * p1.getDouble("x") + b * p1.getDouble("y") - c >= 0); + a = -(L1.y - L0.y); + b = (L1.x - L0.x); + c = a * L0.x + b * L0.y; + s0 = (a * p0.x + b * p0.y - c >= 0); + s1 = (a * p1.x + b * p1.y - c >= 0); return (s0 == s1); } finally { LEAVING("eb4jyrh981apg1fy13fczexdl","same_side"); @@ -2504,7 +2504,7 @@ try { CFunctionImpl ifn; //void (*ifn) (node_t *); if (N(sh)) return enumAsInt(shape_kind.class, "SH_UNSET"); - ifn = (CFunctionImpl) ND_shape(n).getPtr("fns").getPtr("initfn"); + ifn = (CFunctionImpl) ND_shape(n).fns.initfn; if (ifn.getName().equals("poly_init")) return enumAsInt(shape_kind.class, "SH_POLY"); UNSUPPORTED("251a710sgr57bnrs3uh7ppfpi"); // else if (ifn == record_init) @@ -2559,11 +2559,11 @@ try { boolean isBox; int i, j, outp; ST_polygon_t poly = new ST_polygon_t(); regular = ND_shape(n).polygon.regular!=0; - peripheries = ND_shape(n).getPtr("polygon").getInt("peripheries"); - sides = ND_shape(n).getPtr("polygon").getInt("sides"); - orientation = ND_shape(n).getPtr("polygon").getDouble("orientation"); - skew = ND_shape(n).getPtr("polygon").getDouble("skew"); - distortion = ND_shape(n).getPtr("polygon").getDouble("distortion"); + peripheries = ND_shape(n).polygon.peripheries; + sides = ND_shape(n).polygon.sides; + orientation = ND_shape(n).polygon.orientation; + skew = ND_shape(n).polygon.skew; + distortion = ND_shape(n).polygon.distortion; regular |= mapbool(agget(n, new CString("regular"))); /* all calculations in floating point POINTS */ /* make x and y dimensions equal if node is regular @@ -2594,7 +2594,7 @@ UNSUPPORTED("abmuc3vqirf3i48480fj0k14g"); // distortion = late_double(n, N_dist /* get label dimensions */ dimen.___(ND_label(n).dimen); /* minimal whitespace around label */ - if (ROUND(abs(dimen.getDouble("x")))!=0 || ROUND(abs(dimen.getDouble("y")))!=0) { + if (ROUND(abs(dimen.x))!=0 || ROUND(abs(dimen.y))!=0) { /* padding */ if ((p = agget(n, new CString("margin")))!=null) { UNSUPPORTED("4dlqwm3pklzgz2e777dm56n03"); // marginx = marginy = 0; @@ -2613,13 +2613,13 @@ UNSUPPORTED("afk9bpom7x393euamnvwwkx6b"); // } else UNSUPPORTED("87bdwkkwbzyswxnepdd9bj8mb"); // {((dimen).x += 4*4); ((dimen).y += 2*4);}; } else { - ((ST_pointf) dimen).x = dimen.getDouble("x") + 4*4; - ((ST_pointf) dimen).y = dimen.getDouble("y") + 2*4; + ((ST_pointf) dimen).x = dimen.x + 4*4; + ((ST_pointf) dimen).y = dimen.y + 2*4; }; } - spacex = dimen.getDouble("x") - ND_label(n).dimen.getDouble("x"); + spacex = dimen.x - ND_label(n).dimen.x; /* quantization */ - if ((temp = agraphof(n).castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agraphinfo_t.class).getPtr("drawing").getDouble("quantum")) > 0.0) { + if ((temp = ((ST_Agraphinfo_t)agraphof(n).castTo_ST_Agobj_s().data.castTo(ST_Agraphinfo_t.class)).drawing.quantum) > 0.0) { UNSUPPORTED("3nqb0s5rkwj3igt71vooj8asd"); // temp = ((((temp)*72>=0)?(int)((temp)*72 + .5):(int)((temp)*72 - .5))); UNSUPPORTED("5fxtqwy8liyvnx1yvsou5hb4o"); // dimen.x = quant(dimen.x, temp); UNSUPPORTED("et885f1jcqpske6ip856arouv"); // dimen.y = quant(dimen.y, temp); @@ -2659,8 +2659,8 @@ UNSUPPORTED("1x57knvrmlciu7odfroo3paso"); // imagesize.y += 2; UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // } } /* initialize node bb to labelsize */ - ((ST_pointf) bb).x = ((dimen.getDouble("x"))>(imagesize.getInt("x"))?(dimen.getDouble("x")):(imagesize.getInt("x"))); - ((ST_pointf) bb).y = ((dimen.getDouble("y"))>(imagesize.getInt("y"))?(dimen.getDouble("y")):(imagesize.getInt("y"))); + ((ST_pointf) bb).x = ((dimen.x)>(imagesize.x)?(dimen.x):(imagesize.x)); + ((ST_pointf) bb).y = ((dimen.y)>(imagesize.y)?(dimen.y):(imagesize.y)); /* I don't know how to distort or skew ellipses in postscript */ /* Convert request to a polygon with a large number of sides */ if ((sides <= 2) && ((distortion != 0.) || (skew != 0.))) { @@ -2669,14 +2669,14 @@ UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // } /* extra sizing depends on if label is centered vertically */ p = agget(n, new CString("labelloc")); if (p!=null && (p.charAt(0) == 't' || p.charAt(0) == 'b')) - n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).getPtr("label").setInt("valign", p.charAt(0)); + n.castTo_ST_Agobj_s().data.castTo_ST_Agnodeinfo_t().label.setInt("valign", p.charAt(0)); else - n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).getPtr("label").setInt("valign", 'c'); + n.castTo_ST_Agobj_s().data.castTo_ST_Agnodeinfo_t().label.setInt("valign", 'c'); isBox = (sides == 4 && (((orientation>=0)?(int)(orientation + .5):(int)(orientation - .5)) % 90) == 0 && distortion == 0. && skew == 0.); if (isBox) { /* for regular boxes the fit should be exact */ - } else if (n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).getPtr("shape").getPtr("polygon").getPtr("vertices")!=null) { + } else if (((ST_Agnodeinfo_t)n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class)).shape.polygon.vertices!=null) { UNSUPPORTED("4adqsyjwqwzs50ggjp57ok6u7"); // poly_desc_t* pd = (poly_desc_t*)(((Agnodeinfo_t*)(((Agobj_t*)(n))->data))->shape)->polygon->vertices; UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb); } else { @@ -2684,20 +2684,20 @@ UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb); * containing bb centered on the origin, and then pad for that. * We assume the ellipse is defined by a scaling up of bb. */ - temp = bb.getDouble("y") * 1.41421356237309504880; - if (height > temp && (n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).getPtr("label").getInt("valign") == 'c')) { + temp = bb.y * 1.41421356237309504880; + if (height > temp && (((ST_Agnodeinfo_t)n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class)).label.valign == 'c')) { /* if there is height to spare * and the label is centered vertically * then just pad x in proportion to the spare height */ - bb.setDouble("x", bb.getDouble("x") * sqrt(1. / (1. - ((bb.getDouble("y") / height) * (bb.getDouble("y") / height))))); + bb.setDouble("x", bb.x * sqrt(1. / (1. - ((bb.y / height) * (bb.y / height))))); } else { - bb.setDouble("x", bb.getDouble("x") * 1.41421356237309504880); + bb.setDouble("x", bb.x * 1.41421356237309504880); bb.setDouble("y", temp); } if (sides > 2) { temp = cos(3.14159265358979323846 / sides); - bb.setDouble("x", bb.getDouble("x") / temp); - bb.setDouble("y", bb.getDouble("y") / temp); + bb.setDouble("x", bb.x / temp); + bb.setDouble("y", bb.y / temp); /* FIXME - for odd-sided polygons, e.g. triangles, there would be a better fit with some vertical adjustment of the shape */ } @@ -2709,27 +2709,27 @@ UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb); if ((fxd.charAt(0) == 's') && (N(strcmp(fxd,new CString("shape"))))) { bb.setDouble("x", width); bb.setDouble("y", height); - poly.setInt("option", poly.getInt("option") | (1 << 11)); + poly.setInt("option", poly.option | (1 << 11)); } else if (mapbool(fxd)) { /* check only label, as images we can scale to fit */ - if ((width < (n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).getPtr("label").getDouble("dimen.x")) - || (height < (n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).getPtr("label").getDouble("dimen.y"))))) + if ((width < (((ST_Agnodeinfo_t)n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class)).label.dimen.x) + || (height < (((ST_Agnodeinfo_t)n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class)).label.dimen.y)))) System.err.println( "node '%s', graph '%s' size too small for label\n"); //agnameof(n), agnameof(agraphof(n))); bb.setDouble("x", width); bb.setDouble("y", height); } else { - width = MAX(width, bb.getDouble("x")); + width = MAX(width, bb.x); ((ST_pointf) bb).x = width; - height = MAX(height, bb.getDouble("y")); + height = MAX(height, bb.y); ((ST_pointf) bb).y = height; } /* If regular, make dimensions the same. * Need this to guarantee final node size is regular. */ if (regular) { - width = MAX(bb.getDouble("x"), bb.getDouble("y")); + width = MAX(bb.x, bb.y); height = width; ((ST_pointf) bb).x = width; ((ST_pointf) bb).y = width; @@ -2737,22 +2737,22 @@ UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb); /* Compute space available for label. Provides the justification borders */ if (N(mapbool(late_string(n, Z.z().N_nojustify, new CString("false"))))) { if (isBox) { - ((ST_pointf) ND_label(n).space).x = MAX(dimen.getDouble("x"),bb.getDouble("x")) - spacex; + ((ST_pointf) ND_label(n).space).x = MAX(dimen.x,bb.x) - spacex; } - else if (dimen.getDouble("y") < bb.getDouble("y")) { - temp = bb.getDouble("x") * sqrt(1.0 - SQR(dimen.getDouble("y")) / SQR(bb.getDouble("y"))); - ND_label(n).space.setDouble("x", MAX(dimen.getDouble("x"),temp) - spacex); + else if (dimen.y < bb.y) { + temp = bb.x * sqrt(1.0 - SQR(dimen.y) / SQR(bb.y)); + ND_label(n).space.setDouble("x", MAX(dimen.x,temp) - spacex); } else - ND_label(n).space.setDouble("x", dimen.getDouble("x") - spacex); + ND_label(n).space.setDouble("x", dimen.x - spacex); } else { - ND_label(n).space.setDouble("x", dimen.getDouble("x") - spacex); + ND_label(n).space.setDouble("x", dimen.x - spacex); } - if ((poly.getInt("option") & (1 << 11)) == 0) { - temp = bb.getDouble("y") - min_bb.getDouble("y"); - if (dimen.getDouble("y") < imagesize.getInt("y")) - temp += imagesize.getInt("y") - dimen.getDouble("y"); - ((ST_pointf) ND_label(n).space).y = dimen.getDouble("y") + temp; + if ((poly.option & (1 << 11)) == 0) { + temp = bb.y - min_bb.y; + if (dimen.y < imagesize.y) + temp += imagesize.y - dimen.y; + ((ST_pointf) ND_label(n).space).y = dimen.y + temp; } outp = peripheries; if (peripheries < 1) @@ -2760,12 +2760,12 @@ UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb); if (sides < 3) { /* ellipses */ sides = 2; vertices = new ST_pointf.Array(outp * sides); - P.setDouble("x", bb.getDouble("x") / 2.); - P.setDouble("y", bb.getDouble("y") / 2.); - vertices.setDouble("x", -P.getDouble("x")); - vertices.setDouble("y", -P.getDouble("y")); - vertices.plus(1).setDouble("x", P.getDouble("x")); - vertices.plus(1).setDouble("y", P.getDouble("y")); + P.setDouble("x", bb.x / 2.); + P.setDouble("y", bb.y / 2.); + vertices.setDouble("x", -P.x); + vertices.setDouble("y", -P.y); + vertices.plus(1).setDouble("x", P.x); + vertices.plus(1).setDouble("y", P.y); if (peripheries > 1) { UNSUPPORTED("4ofenmfgj7cgyf624qmugcx77"); // for (j = 1, i = 2; j < peripheries; j++) { UNSUPPORTED("458w3r6n3nidn2j2b154phpzt"); // P.x += 4; @@ -2794,7 +2794,7 @@ UNSUPPORTED("b5z0hw4dacenv33xsaex70g8d"); // bb.y = 2. * P.y; * the current segments, and outside by GAP distance, intersect. */ vertices = new ST_pointf.Array(outp * sides); - if (((ST_polygon_t)ND_shape(n).getPtr("polygon")).vertices!=null) { + if (((ST_polygon_t)ND_shape(n).polygon).vertices!=null) { UNSUPPORTED("3ghle84ieryaenfnlbzrfv7bw"); // poly_desc_t* pd = (poly_desc_t*)(((Agnodeinfo_t*)(((Agobj_t*)(n))->data))->shape)->polygon->vertices; UNSUPPORTED("227lpcg9dt83m2bm8yshb4djf"); // pd->vertex_gen (vertices, &bb); UNSUPPORTED("cc3jvnwvbhjhro4adeet363yd"); // xmax = bb.x/2; @@ -2815,33 +2815,33 @@ UNSUPPORTED("39rdmp8vl9muqtv7xs1xwtrwk"); // ymax = bb.y/2; /*next regular vertex */ angle += sectorangle; sinx = sin(angle); cosx = cos(angle); - ((ST_pointf) R).x = R.getDouble("x") + sidelength * cosx; - ((ST_pointf) R).y = R.getDouble("y") + sidelength * sinx; + ((ST_pointf) R).x = R.x + sidelength * cosx; + ((ST_pointf) R).y = R.y + sidelength * sinx; /*distort and skew */ - ((ST_pointf) P).x = R.getDouble("x") * (skewdist + R.getDouble("y") * gdistortion) + R.getDouble("y") * gskew; - ((ST_pointf) P).y = R.getDouble("y"); + ((ST_pointf) P).x = R.x * (skewdist + R.y * gdistortion) + R.y * gskew; + ((ST_pointf) P).y = R.y; /*orient P.x,P.y */ - alpha = RADIANS(orientation) + atan2(P.getDouble("y"), P.getDouble("x")); + alpha = RADIANS(orientation) + atan2(P.y, P.x); sinx = sin(alpha); cosx = cos(alpha); - ((ST_pointf) P).y = hypot(P.getDouble("x"), P.getDouble("y")); - ((ST_pointf) P).x = P.getDouble("y"); - ((ST_pointf) P).x = P.getDouble("x") * cosx; - ((ST_pointf) P).y = P.getDouble("y") * sinx; + ((ST_pointf) P).y = hypot(P.x, P.y); + ((ST_pointf) P).x = P.y; + ((ST_pointf) P).x = P.x * cosx; + ((ST_pointf) P).y = P.y * sinx; /*scale for label */ - ((ST_pointf) P).x = P.getDouble("x") * bb.getDouble("x"); - ((ST_pointf) P).y = P.getDouble("y") * bb.getDouble("y"); + ((ST_pointf) P).x = P.x * bb.x; + ((ST_pointf) P).y = P.y * bb.y; /*find max for bounding box */ - xmax = MAX(fabs(P.getDouble("x")), xmax); - ymax = MAX(fabs(P.getDouble("y")), ymax); + xmax = MAX(fabs(P.x), xmax); + ymax = MAX(fabs(P.y), ymax); /* store result in array of points */ vertices.plus(i).setStruct(P); if (isBox) { /* enforce exact symmetry of box */ - vertices.get(1).x = -P.getDouble("x"); - vertices.get(1).y = P.getDouble("y"); - vertices.get(2).x = -P.getDouble("x"); - vertices.get(2).y = -P.getDouble("y"); - vertices.get(3).x = P.getDouble("x"); - vertices.get(3).y = -P.getDouble("y"); + vertices.get(1).x = -P.x; + vertices.get(1).y = P.y; + vertices.get(2).x = -P.x; + vertices.get(2).y = -P.y; + vertices.get(3).x = P.x; + vertices.get(3).y = -P.y; break; } } @@ -2851,12 +2851,12 @@ UNSUPPORTED("39rdmp8vl9muqtv7xs1xwtrwk"); // ymax = bb.y/2; ymax *= 2.; ((ST_pointf) bb).x = MAX(width, xmax); ((ST_pointf) bb).y = MAX(height, ymax); - scalex = bb.getDouble("x") / xmax; - scaley = bb.getDouble("y") / ymax; + scalex = bb.x / xmax; + scaley = bb.y / ymax; for (i = 0; i < sides; i++) { P.____(vertices.plus(i)); - ((ST_pointf) P).x = P.getDouble("x") * scalex; - ((ST_pointf) P).y = P.getDouble("y") * scaley; + ((ST_pointf) P).x = P.x * scalex; + ((ST_pointf) P).y = P.y * scaley; vertices.plus(i).setStruct(P); } if (peripheries > 1) { @@ -2900,15 +2900,15 @@ UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // } poly.setDouble("skew", skew); poly.setDouble("distortion", distortion); poly.vertices = vertices; - if ((poly.getInt("option") & (1 << 11))!=0) { + if ((poly.option & (1 << 11))!=0) { /* set width and height to reflect label and shape */ UNSUPPORTED("7kk8oru3b3copylmq3gssx6qx"); // (((Agnodeinfo_t*)(((Agobj_t*)(n))->data))->width) = ((((dimen.x)>(bb.x)?(dimen.x):(bb.x)))/(double)72); UNSUPPORTED("8oouzms2x039fhfcfxm7yc4su"); // (((Agnodeinfo_t*)(((Agobj_t*)(n))->data))->height) = ((((dimen.y)>(bb.y)?(dimen.y):(bb.y)))/(double)72); } else { - n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).setDouble("width", ((bb.getDouble("x"))/(double)72)); - n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).setDouble("height", ((bb.getDouble("y"))/(double)72)); + n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class).setDouble("width", ((bb.x)/(double)72)); + n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class).setDouble("height", ((bb.y)/(double)72)); } - n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).setPtr("shape_info", poly); + n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class).setPtr("shape_info", poly); } finally { LEAVING("a11xv6duihbr3d6gkgo2ye2j5","poly_init"); } @@ -2953,8 +2953,8 @@ try { int i, i1, j; boolean s; final ST_pointf P = new ST_pointf(), Q = new ST_pointf(), R = new ST_pointf(); - __ptr__ bp = inside_context.getPtr("s.bp"); - __ptr__ n = inside_context.getPtr("s.n"); + ST_boxf bp = inside_context.s_bp; + ST_Agnode_s n = inside_context.s_n; P.___(ccwrotatepf(p, 90 * GD_rankdir(agraphof(n)))); /* Quick test if port rectangle is target */ if (bp!=null) { @@ -2966,8 +2966,8 @@ try { double n_width = 0, n_height = 0; Z.z().poly = (ST_polygon_t) ND_shape_info(n); Z.z().vertex = Z.z().poly.vertices; - Z.z().sides = Z.z().poly.getInt("sides"); - if ((Z.z().poly.getInt("option") & (1 << 11))!=0) { + Z.z().sides = Z.z().poly.sides; + if ((Z.z().poly.option & (1 << 11))!=0) { UNSUPPORTED("18yw1scg4sol8bhyf1vedj9kn"); // boxf bb = polyBB(poly); UNSUPPORTED("7rz7vxyxao0efec2nvd6g19m1"); // n_width = bb.UR.x - bb.LL.x; UNSUPPORTED("4h0k2wroz3xqx1ljokdbaqaad"); // n_height = bb.UR.y - bb.LL.y; @@ -3001,20 +3001,20 @@ UNSUPPORTED("8t3g4d9acruono62leh5a8hxh"); // xsize = ND_ht(n); Z.z().box_URx = n_width / 2.0; Z.z().box_URy = n_height / 2.0; /* index to outer-periphery */ - Z.z().outp = (Z.z().poly.getInt("peripheries") - 1) * Z.z().sides; + Z.z().outp = (Z.z().poly.peripheries - 1) * Z.z().sides; if (Z.z().outp < 0) Z.z().outp = 0; Z.z().lastn = (ST_Agnode_s) n; } /* scale */ - P.setDouble("x", P.getDouble("x") * Z.z().scalex); - P.setDouble("y", P.getDouble("y") * Z.z().scaley); + P.setDouble("x", P.x * Z.z().scalex); + P.setDouble("y", P.y * Z.z().scaley); /* inside bounding box? */ - if ((fabs(P.getDouble("x")) > Z.z().box_URx) || (fabs(P.getDouble("y")) > Z.z().box_URy)) + if ((fabs(P.x) > Z.z().box_URx) || (fabs(P.y) > Z.z().box_URy)) return false; /* ellipses */ if (Z.z().sides <= 2) - return (hypot(P.getDouble("x") / Z.z().box_URx, P.getDouble("y") / Z.z().box_URy) < 1.); + return (hypot(P.x / Z.z().box_URx, P.y / Z.z().box_URy) < 1.); /* use fast test in case we are converging on a segment */ i = Z.z().last % Z.z().sides; /* in case last left over from larger polygon */ i1 = (i + 1) % Z.z().sides; diff --git a/src/gen/lib/common/splines__c.java b/src/gen/lib/common/splines__c.java index 51bd825d6..d209f1e01 100644 --- a/src/gen/lib/common/splines__c.java +++ b/src/gen/lib/common/splines__c.java @@ -79,7 +79,8 @@ import static smetana.core.Macro.ND_order; import static smetana.core.Macro.ND_rank; import static smetana.core.Macro.ND_rw; import static smetana.core.Macro.ND_shape; -import static smetana.core.Macro.*; +import static smetana.core.Macro.NOT; +import static smetana.core.Macro.NOTI; import static smetana.core.Macro.UNSUPPORTED; import h.ST_Agedge_s; import h.ST_Agnode_s; @@ -422,8 +423,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -720,7 +721,7 @@ throw new UnsupportedOperationException(); //3 6izm0fbkejw7odmiw4zaw1ycp // static void arrow_clip(edge_t * fe, node_t * hn, pointf * ps, int *startp, int *endp, bezier * spl, splineInfo * info) -public static void arrow_clip(ST_Agedge_s fe, ST_Agnode_s hn, __ptr__ ps, int startp[], int endp[], ST_bezier spl, ST_splineInfo info) { +public static void arrow_clip(ST_Agedge_s fe, ST_Agnode_s hn, ST_pointf.Array ps, int startp[], int endp[], ST_bezier spl, ST_splineInfo info) { ENTERING("6izm0fbkejw7odmiw4zaw1ycp","arrow_clip"); try { ST_Agedge_s e; @@ -732,11 +733,11 @@ try { if (info.ignoreSwap) j = false; else - j = (Boolean) info.call("swapEnds", e); + j = (Boolean) info.swapEnds.exe(e); arrow_flags(e, sflag, eflag); - if ((Boolean) info.call("splineMerge", hn)) + if ((Boolean) info.splineMerge.exe(hn)) eflag[0] = 0; - if ((Boolean) info.call("splineMerge", agtail(fe))) + if ((Boolean) info.splineMerge.exe(agtail(fe))) sflag[0] = 0; /* swap the two ends */ if (j) { @@ -806,7 +807,7 @@ try { found = NOT(false); odir.setValue(t); } - } while (ABS(opt.getDouble("x") - pt.getDouble("x")) > .5 || ABS(opt.getDouble("y") - pt.getDouble("y")) > .5); + } while (ABS(opt.x - pt.x) > .5 || ABS(opt.y - pt.y) > .5); if (found) for (i = 0; i < 4; i++) sp.plus(i).setStruct(best.plus(i).getStruct()); @@ -823,7 +824,7 @@ LEAVING("q4t1ywnk3wm1vyh5seoj7xye","bezier_clip"); //3 1fjkj1ydhtlf13pqj5r041orq // static void shape_clip0(inside_t * inside_context, node_t * n, pointf curve[4], boolean left_inside) -public static void shape_clip0(__ptr__ inside_context, ST_Agnode_s n, __ptr__ curve, boolean left_inside) { +public static void shape_clip0(__ptr__ inside_context, ST_Agnode_s n, ST_pointf.Array curve, boolean left_inside) { ENTERING("1fjkj1ydhtlf13pqj5r041orq","shape_clip0"); try { int i; @@ -831,14 +832,14 @@ try { final ST_pointf.Array c = new ST_pointf.Array( 4); save_real_size = ND_rw(n); for (i = 0; i < 4; i++) { - c.plus(i).setDouble("x", curve.plus(i).getDouble("x") - ND_coord(n).getDouble("x")); - c.plus(i).setDouble("y", curve.plus(i).getDouble("y") - ND_coord(n).getDouble("y")); + c.plus(i).setDouble("x", curve.get(i).x - ND_coord(n).x); + c.plus(i).setDouble("y", curve.get(i).y - ND_coord(n).y); } - bezier_clip(inside_context, ND_shape(n).getPtr("fns").getPtr("insidefn"), c, + bezier_clip(inside_context, ND_shape(n).fns.insidefn, c, left_inside); for (i = 0; i < 4; i++) { - curve.plus(i).setDouble("x", c.plus(i).getDouble("x") + ND_coord(n).getDouble("x")); - curve.plus(i).setDouble("y", c.plus(i).getDouble("y") + ND_coord(n).getDouble("y")); + curve.plus(i).setDouble("x", c.get(i).x + ND_coord(n).x); + curve.plus(i).setDouble("y", c.get(i).y + ND_coord(n).y); } ND_rw(n, save_real_size); } finally { @@ -893,10 +894,10 @@ try { rv.setInt("size", sz); rv.setInt("sflag", 0); rv.setInt("eflag", 0); - rv.getStruct("sp").setDouble("x", 0); - rv.getStruct("sp").setDouble("y", 0); - rv.getStruct("ep").setDouble("x", 0); - rv.getStruct("ep").setDouble("y", 0); + rv.sp.setDouble("x", 0); + rv.sp.setDouble("y", 0); + rv.ep.setDouble("x", 0); + rv.ep.setDouble("y", 0); return rv; } finally { LEAVING("bdirexg1qdtophlh0ofjvsmj7","new_spline"); @@ -908,7 +909,7 @@ LEAVING("bdirexg1qdtophlh0ofjvsmj7","new_spline"); //3 duednxyuvf6xrff752uuv620f // void clip_and_install(edge_t * fe, node_t * hn, pointf * ps, int pn, splineInfo * info) -public static void clip_and_install(ST_Agedge_s fe, ST_Agnode_s hn, __ptr__ ps, int pn, ST_splineInfo info) { +public static void clip_and_install(ST_Agedge_s fe, ST_Agnode_s hn, ST_pointf.Array ps, int pn, ST_splineInfo info) { ENTERING("duednxyuvf6xrff752uuv620f","clip_and_install"); try { final ST_pointf p2 = new ST_pointf(); @@ -933,37 +934,37 @@ try { tn = tmp; } if (EQ(tn, agtail(orig))) { - clipTail = ED_tail_port(orig).getInt("clip"); - clipHead = ED_head_port(orig).getInt("clip"); - tbox = (ST_boxf) ED_tail_port(orig).getPtr("bp"); - hbox = (ST_boxf) ED_head_port(orig).getPtr("bp"); + clipTail = ED_tail_port(orig).clip; + clipHead = ED_head_port(orig).clip; + tbox = (ST_boxf) ED_tail_port(orig).bp; + hbox = (ST_boxf) ED_head_port(orig).bp; } else { /* fe and orig are reversed */ - clipTail = ED_head_port(orig).getInt("clip"); - clipHead = ED_tail_port(orig).getInt("clip"); - hbox = (ST_boxf) ED_tail_port(orig).getPtr("bp"); - tbox = (ST_boxf) ED_head_port(orig).getPtr("bp"); + clipTail = ED_head_port(orig).clip; + clipHead = ED_tail_port(orig).clip; + hbox = (ST_boxf) ED_tail_port(orig).bp; + tbox = (ST_boxf) ED_head_port(orig).bp; } /* spline may be interior to node */ - if(clipHead!=0 && ND_shape(tn)!=null && ND_shape(tn).getPtr("fns").getPtr("insidefn")!=null) { + if(clipHead!=0 && ND_shape(tn)!=null && ND_shape(tn).fns.insidefn!=null) { inside_context.setPtr("s.n", tn); inside_context.setPtr("s.bp", tbox); for (start[0] = 0; start[0] < pn - 4; start[0] += 3) { - p2.setDouble("x", ps.plus(start[0] + 3).getDouble("x") - ND_coord(tn).getDouble("x")); - p2.setDouble("y", ps.plus(start[0] + 3).getDouble("y") - ND_coord(tn).getDouble("y")); - if (((Boolean)ND_shape(tn).getPtr("fns").call("insidefn", inside_context, p2)) == false) + p2.setDouble("x", ps.get(start[0] + 3).x - ND_coord(tn).x); + p2.setDouble("y", ps.get(start[0] + 3).y - ND_coord(tn).y); + if (((Boolean)ND_shape(tn).fns.insidefn.exe(inside_context, p2)) == false) break; } shape_clip0(inside_context, tn, ps.plus(start[0]), NOT(false)); } else start[0] = 0; - if(clipHead!=0 && ND_shape(hn)!=null && ND_shape(hn).getPtr("fns").getPtr("insidefn")!=null) { + if(clipHead!=0 && ND_shape(hn)!=null && ND_shape(hn).fns.insidefn!=null) { inside_context.setPtr("s.n", hn); inside_context.setPtr("s.bp", hbox); for (end[0] = pn - 4; end[0] > 0; end[0] -= 3) { - p2.setDouble("x", ps.plus(end[0]).getDouble("x") - ND_coord(hn).getDouble("x")); - p2.setDouble("y", ps.plus(end[0]).getDouble("y") - ND_coord(hn).getDouble("y")); - if (((Boolean)ND_shape(hn).getPtr("fns").call("insidefn", inside_context, p2)) == false) + p2.setDouble("x", ps.get(end[0]).x - ND_coord(hn).x); + p2.setDouble("y", ps.get(end[0]).y - ND_coord(hn).y); + if (((Boolean)ND_shape(hn).fns.insidefn.exe(inside_context, p2)) == false) break; } shape_clip0(inside_context, hn, ps.plus(end[0]), false); @@ -1047,8 +1048,8 @@ ENTERING("egq4f4tmy1dhyj6jpj92r7xhu","add_box"); try { if (b.LL.x < b.UR.x && b.LL.y < b.UR.y) { - P.boxes[P.getInt("nbox")].setStruct(b); - P.setInt("nbox", P.getInt("nbox")+1); + P.boxes[P.nbox].setStruct(b); + P.nbox = P.nbox+1; } } finally { LEAVING("egq4f4tmy1dhyj6jpj92r7xhu","add_box"); @@ -1070,24 +1071,24 @@ try { if (ED_tail_port(e).dyna!=0) ED_tail_port(e, resolvePort(agtail(e), aghead(e), ED_tail_port(e))); if (ND_shape(n)!=null) - pboxfn = (CFunction) ND_shape(n).getPtr("fns").getPtr("pboxfn"); + pboxfn = (CFunction) ND_shape(n).fns.pboxfn; else pboxfn = null; - P.start.setStruct("p", add_pointf(ND_coord(n), (ST_pointf) ED_tail_port(e).getStruct("p"))); + P.start.setStruct("p", add_pointf(ND_coord(n), (ST_pointf) ED_tail_port(e).p)); if (merge) { /*P->start.theta = - M_PI / 2; */ P.start.setDouble("theta", conc_slope(agtail(e))); P.start.constrained= NOTI(false); } else { if (ED_tail_port(e).constrained!=0) { - P.start.setDouble("theta", ED_tail_port(e).getDouble("theta")); + P.start.setDouble("theta", ED_tail_port(e).theta); P.start.constrained= NOTI(false); } else P.start.constrained= 0; } - P.setInt("nbox", 0); + P.nbox = 0; P.setPtr("data", e); - endp.setStruct("np", P.start.getStruct("p")); + endp.setStruct("np", P.start.p); if ((et == 1) && (ND_node_type(n) == 0) && ((side = ED_tail_port(e).side)!=0)) { UNSUPPORTED("a7lrhlfwr0y475aqjk6abhb3b"); // edge_t* orig; UNSUPPORTED("ew7nyfe712nsiphifeztwxfop"); // boxf b0, b = endp->nb; @@ -1221,12 +1222,12 @@ UNSUPPORTED("8jqn3kj2hrrlcifbw3x9sf6qu"); // endp->sidemask = side; UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return; } if (et == 1) side = (1<<0); - else side = endp.getInt("sidemask"); /* for flat edges */ + else side = endp.sidemask; /* for flat edges */ if (pboxfn!=null - && (mask = (Integer) pboxfn.exe(n, ED_tail_port(e), side, endp.boxes[0], endp.getInt("boxn")))!=0) + && (mask = (Integer) pboxfn.exe(n, ED_tail_port(e), side, endp.boxes[0], endp.boxn))!=0) UNSUPPORTED("ex9kjvshm19zbu9vqonk1avd8"); // endp->sidemask = mask; else { - endp.boxes[0].setStruct(endp.getStruct("nb")); + endp.boxes[0].setStruct(endp.nb); endp.setInt("boxn", 1); switch (et) { case 8: @@ -1238,15 +1239,15 @@ UNSUPPORTED("46vb5zg9vm9n0q21g53nj66v3"); // endp->boxes[0].UR.y = P->start UNSUPPORTED("auefgwb39x5hzqqc9b1zgl239"); // endp->sidemask = (1<<0); break; case 2: - if (endp.getInt("sidemask") == (1<<2)) - ((ST_boxf)endp.boxes[0]).LL.y = P.start.getStruct("p").getDouble("y"); + if (endp.sidemask == (1<<2)) + ((ST_boxf)endp.boxes[0]).LL.y = P.start.p.y; else - ((ST_boxf)endp.boxes[0]).UR.y = P.start.getStruct("p").getDouble("y"); + ((ST_boxf)endp.boxes[0]).UR.y = P.start.p.y; break; case 1: - ((ST_boxf)(endp).boxes[0]).UR.y = P.start.getStruct("p").getDouble("y"); + ((ST_boxf)(endp).boxes[0]).UR.y = P.start.p.y; endp.setInt("sidemask", (1<<0)); - P.start.getStruct("p").setDouble("y", P.start.getStruct("p").getDouble("y") - 1); + P.start.p.setDouble("y", P.start.p.y - 1); break; } } @@ -1270,10 +1271,10 @@ try { if (ED_head_port(e).dyna!=0) UNSUPPORTED("9brhx94sjudx3jtzrnwa60x8"); // ED_head_port(e) = resolvePort(aghead(e), agtail(e), &ED_head_port(e)); if (ND_shape(n)!=null) - pboxfn = (CFunction) ND_shape(n).getPtr("fns").getPtr("pboxfn"); + pboxfn = (CFunction) ND_shape(n).fns.pboxfn; else pboxfn = null; - P.getStruct("end").setStruct("p", add_pointf(ND_coord(n), (ST_pointf) ED_head_port(e).getStruct("p"))); + P.end.setStruct("p", add_pointf(ND_coord(n), (ST_pointf) ED_head_port(e).p)); if (merge) { UNSUPPORTED("cproejwusj67kuugolh6tbkwz"); // /*P->end.theta = M_PI / 2; */ UNSUPPORTED("65vhfvz1d1tub3f85tdsgg2g5"); // P->end.theta = conc_slope(aghead(e)) + M_PI; @@ -1281,12 +1282,12 @@ UNSUPPORTED("du4hwt6pjf3bmkvowssm7b0uo"); // assert(P->end.theta < 2 * M_PI); UNSUPPORTED("2w0c22i5xgcch77xd9jg104nw"); // P->end.constrained = NOT(0); } else { if (ED_head_port(e).constrained!=0) { - P.getStruct("end").setDouble("theta", ED_head_port(e).getDouble("theta")); - P.getStruct("end").setInt("constrained", 1); + P.end.setDouble("theta", ED_head_port(e).theta); + P.end.setInt("constrained", 1); } else - P.getStruct("end").setInt("constrained", 0); + P.end.setInt("constrained", 0); } - endp.setStruct("np", P.getStruct("end").getStruct("p")); + endp.setStruct("np", P.end.p); if ((et == 1) && (ND_node_type(n) == 0) && ((side = ED_head_port(e).side)!=0)) { UNSUPPORTED("a7lrhlfwr0y475aqjk6abhb3b"); // edge_t* orig; UNSUPPORTED("ew7nyfe712nsiphifeztwxfop"); // boxf b0, b = endp->nb; @@ -1421,12 +1422,12 @@ UNSUPPORTED("8jqn3kj2hrrlcifbw3x9sf6qu"); // endp->sidemask = side; UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return; } if (et == 1) side = (1<<2); - else side = endp.getInt("sidemask"); /* for flat edges */ + else side = endp.sidemask; /* for flat edges */ if (pboxfn!=null - && (mask = (Integer) pboxfn.exe(n, ED_head_port(e), side, endp.boxes[0], endp.getInt("boxn")))!=0) + && (mask = (Integer) pboxfn.exe(n, ED_head_port(e), side, endp.boxes[0], endp.boxn))!=0) endp.setInt("sidemask", mask); else { - endp.boxes[0].setStruct(endp.getStruct("nb")); + endp.boxes[0].setStruct(endp.nb); endp.setInt("boxn", 1); switch (et) { case 8: @@ -1438,15 +1439,15 @@ UNSUPPORTED("db6vmvnse8bawy8qwct7l24u8"); // endp->boxes[0].LL.y = P->end.p UNSUPPORTED("1r4lctdj9z1ivlz3uqpcj1yzf"); // endp->sidemask = (1<<2); UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // break; case 2: - if (endp.getInt("sidemask") == (1<<2)) - endp.boxes[0].LL.y = P.getStruct("end").getStruct("p").getDouble("y"); + if (endp.sidemask == (1<<2)) + endp.boxes[0].LL.y = P.end.p.y; else - endp.boxes[0].UR.y = P.getStruct("end").getStruct("p").getDouble("y"); + endp.boxes[0].UR.y = P.end.p.y; break; case 1: - endp.boxes[0].LL.y = P.getStruct("end").getStruct("p").getDouble("y"); + endp.boxes[0].LL.y = P.end.p.y; endp.setInt("sidemask", (1<<2)); - P.getStruct("end").getStruct("p").setDouble("y", P.getStruct("end").getStruct("p").getDouble("y") +1); + P.end.p.setDouble("y", P.end.p.y +1); break; } } @@ -1684,7 +1685,7 @@ throw new UnsupportedOperationException(); //3 3sr8gvj4141qql0v12lb89cyt // static void selfRight (edge_t* edges[], int ind, int cnt, double stepx, double sizey, splineInfo* sinfo) -public static void selfRight(__ptr__ edges, int ind, int cnt, double stepx, double sizey, ST_splineInfo sinfo) { +public static void selfRight(ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, double stepx, double sizey, ST_splineInfo sinfo) { ENTERING("3sr8gvj4141qql0v12lb89cyt","selfRight"); try { int i, sgn, point_pair; @@ -1694,19 +1695,19 @@ try { ST_Agedge_s e; final ST_pointf.Array points = new ST_pointf.Array( 1000); int pointn; - e = (ST_Agedge_s) edges.plus(ind).getPtr(); + e = (ST_Agedge_s) edges.get(ind); n = agtail(e); stepy = (sizey / 2.) / cnt; stepy = MAX(stepy, 2.); pointn = 0; np.___(ND_coord(n)); - tp.___(ED_tail_port(e).getStruct("p")); - tp.setDouble("x", tp.getDouble("x") + np.getDouble("x")); - tp.setDouble("y", tp.getDouble("y") + np.getDouble("y")); - hp.___(ED_head_port(e).getStruct("p")); - hp.setDouble("x", hp.getDouble("x") + np.getDouble("x")); - hp.setDouble("y", hp.getDouble("y") + np.getDouble("y")); - if (tp.getDouble("y") >= hp.getDouble("y")) sgn = 1; + tp.___(ED_tail_port(e).p); + tp.setDouble("x", tp.x + np.x); + tp.setDouble("y", tp.y + np.y); + hp.___(ED_head_port(e).p); + hp.setDouble("x", hp.x + np.x); + hp.setDouble("y", hp.y + np.y); + if (tp.y >= hp.y) sgn = 1; else sgn = -1; dx = ND_rw(n); dy = 0; @@ -1715,35 +1716,35 @@ try { point_pair = convert_sides_to_points(ED_tail_port(e).side,ED_head_port(e).side); switch(point_pair){ case 32: - case 65: if(tp.getDouble("y") == hp.getDouble("y")) + case 65: if(tp.y == hp.y) sgn = -sgn; break; default: break; } - tx = MIN(dx, 3*(np.getDouble("x") + dx - tp.getDouble("x"))); - hx = MIN(dx, 3*(np.getDouble("x") + dx - hp.getDouble("x"))); + tx = MIN(dx, 3*(np.x + dx - tp.x)); + hx = MIN(dx, 3*(np.x + dx - hp.x)); for (i = 0; i < cnt; i++) { e = (ST_Agedge_s) edges.plus(ind++).getPtr(); dx += stepx; tx += stepx; hx += stepx; dy += sgn*stepy; pointn = 0; points.plus(pointn++).setStruct(tp); - points.plus(pointn++).setStruct(pointfof(tp.getDouble("x") + tx / 3, tp.getDouble("y") + dy)); - points.plus(pointn++).setStruct(pointfof(np.getDouble("x") + dx, tp.getDouble("y") + dy)); - points.plus(pointn++).setStruct(pointfof(np.getDouble("x") + dx, (tp.getDouble("y")+hp.getDouble("y"))/2)); - points.plus(pointn++).setStruct(pointfof(np.getDouble("x") + dx, hp.getDouble("y") - dy)); - points.plus(pointn++).setStruct(pointfof(hp.getDouble("x") + hx / 3, hp.getDouble("y") - dy)); + points.plus(pointn++).setStruct(pointfof(tp.x + tx / 3, tp.y + dy)); + points.plus(pointn++).setStruct(pointfof(np.x + dx, tp.y + dy)); + points.plus(pointn++).setStruct(pointfof(np.x + dx, (tp.y+hp.y)/2)); + points.plus(pointn++).setStruct(pointfof(np.x + dx, hp.y - dy)); + points.plus(pointn++).setStruct(pointfof(hp.x + hx / 3, hp.y - dy)); points.plus(pointn++).setStruct(hp); if (ED_label(e)!=null) { if (GD_flip(agraphof(agtail(e)))!=0) { - width = ED_label(e).dimen.getDouble("y"); - height = ED_label(e).dimen.getDouble("x"); + width = ED_label(e).dimen.y; + height = ED_label(e).dimen.x; } else { - width = ED_label(e).dimen.getDouble("x"); - height = ED_label(e).dimen.getDouble("y"); + width = ED_label(e).dimen.x; + height = ED_label(e).dimen.y; } - ED_label(e).getStruct("pos").setDouble("x", ND_coord(n).getDouble("x") + dx + width / 2.0); - ED_label(e).getStruct("pos").setDouble("y", ND_coord(n).getDouble("y")); + ED_label(e).pos.setDouble("x", ND_coord(n).x + dx + width / 2.0); + ED_label(e).pos.setDouble("y", ND_coord(n).y); ED_label(e).set= NOTI(false); if (width > stepx) dx += width - stepx; @@ -1854,7 +1855,7 @@ try { )) { sw = 18; if (l!=null) { - label_width = GD_flip(agraphof(aghead(e)))!=0 ? l.dimen.getDouble("y") : l.dimen.getDouble("x"); + label_width = GD_flip(agraphof(aghead(e)))!=0 ? l.dimen.y : l.dimen.x; sw += label_width; } } @@ -1870,11 +1871,11 @@ LEAVING("678whq05s481ertx02jloteu3","selfRightSpace"); //3 bt3fwgprixbc5rceeewozdqr9 // void makeSelfEdge(path * P, edge_t * edges[], int ind, int cnt, double sizex, double sizey, splineInfo * sinfo) -public static void makeSelfEdge(ST_path P, __ptr__ edges, int ind, int cnt, double sizex, double sizey, ST_splineInfo sinfo) { +public static void makeSelfEdge(ST_path P, ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, double sizex, double sizey, ST_splineInfo sinfo) { ENTERING("bt3fwgprixbc5rceeewozdqr9","makeSelfEdge"); try { ST_Agedge_s e; - e = (ST_Agedge_s) edges.plus(ind).getPtr(); + e = (ST_Agedge_s) edges.get(ind); /* self edge without ports or * self edge with all ports inside, on the right, or at most 1 on top * and at most 1 on bottom @@ -1944,7 +1945,7 @@ public static void endPoints(ST_splines spl, ST_pointf p, ST_pointf q) { ENTERING("7wyn51o9k6u7joaq9k18boffh","endPoints"); try { final ST_bezier bz = new ST_bezier(); - bz.____(spl.list.plus(0).getPtr()); + bz.____(spl.list.get(0)); if (bz.sflag!=0) { UNSUPPORTED("4wazlko0bxmzxoobqacij1btk"); // *p = bz.sp; } diff --git a/src/gen/lib/common/textspan__c.java b/src/gen/lib/common/textspan__c.java index b64269861..2f8ab31af 100644 --- a/src/gen/lib/common/textspan__c.java +++ b/src/gen/lib/common/textspan__c.java @@ -50,7 +50,7 @@ import static smetana.core.Macro.UNSUPPORTED; import h.ST_GVC_s; import h.ST_dt_s; import h.ST_pointf; -import smetana.core.__ptr__; +import h.ST_textspan_t; public class textspan__c { //1 9k44uhd5foylaeoekf3llonjq @@ -376,8 +376,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -773,17 +773,17 @@ throw new UnsupportedOperationException(); //3 n8tcl06mifdn779rzenam44z // pointf textspan_size(GVC_t *gvc, textspan_t * span) -public static ST_pointf textspan_size(ST_GVC_s gvc, __ptr__ span) { +public static ST_pointf textspan_size(ST_GVC_s gvc, ST_textspan_t span) { // WARNING!! STRUCT return textspan_size_w_(gvc, span).copy(); } -private static ST_pointf textspan_size_w_(ST_GVC_s gvc, __ptr__ span) { +private static ST_pointf textspan_size_w_(ST_GVC_s gvc, ST_textspan_t span) { ENTERING("n8tcl06mifdn779rzenam44z","textspan_size"); try { System.err.println("Warning:textspan_size "+span); - span.getStruct("size").setDouble("x", 30); - span.getStruct("size").setDouble("y", 20); - return (ST_pointf) span.getStruct("size").copy(); + span.size.setDouble("x", 30); + span.size.setDouble("y", 20); + return span.size.copy(); } finally { LEAVING("n8tcl06mifdn779rzenam44z","textspan_size"); } diff --git a/src/gen/lib/common/utils__c.java b/src/gen/lib/common/utils__c.java index eaf5184db..2346e203d 100644 --- a/src/gen/lib/common/utils__c.java +++ b/src/gen/lib/common/utils__c.java @@ -436,8 +436,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -759,7 +759,7 @@ LEAVING("c7cptalfn8k75wyfirbnptnav","new_queue"); public static void free_queue(ST_nodequeue q) { ENTERING("1uj5nmdvwmuklnpd3v5py547f","free_queue"); try { - Memory.free(q.getPtr("store")); + Memory.free(q.store); Memory.free(q); } finally { LEAVING("1uj5nmdvwmuklnpd3v5py547f","free_queue"); @@ -775,9 +775,9 @@ public static void enqueue(ST_nodequeue q, ST_Agnode_s n) { ENTERING("20pwd6i141q3o25lfvrdqytot","enqueue"); try { q.tail.plus(0).setPtr(n); - q.setPtr("tail", q.getPtr("tail").plus(1)); - if (q.getPtr("tail").comparePointer(q.getPtr("limit")) >= 0) - q.setPtr("tail", q.getPtr("store")); + q.setPtr("tail", q.tail.plus(1)); + if (q.tail.comparePointer(q.limit) >= 0) + q.setPtr("tail", q.store); } finally { LEAVING("20pwd6i141q3o25lfvrdqytot","enqueue"); } @@ -792,13 +792,13 @@ public static ST_Agnode_s dequeue(ST_nodequeue q) { ENTERING("b612nmtf16au96ztbs8pike9r","dequeue"); try { ST_Agnode_s n; - if (EQ(q.getPtr("head"), q.getPtr("tail"))) + if (EQ(q.head, q.tail)) n = null; else { - n = (ST_Agnode_s) q.head.plus(0).getPtr(); - q.setPtr("head", q.getPtr("head").plus(1)); - if (q.getPtr("head").comparePointer(q.getPtr("limit")) >= 0) - q.setPtr("head", q.getPtr("store")); + n = (ST_Agnode_s) q.head.get(0); + q.setPtr("head", q.head.plus(1)); + if (q.head.comparePointer(q.limit) >= 0) + q.setPtr("head", q.store); } return n; } finally { @@ -1071,9 +1071,9 @@ try { for (i = 1; i <= degree; i++) { for (j = 0; j <= degree - i; j++) { Vtemp[i].plus(j).setDouble("x", - (1.0 - t) * Vtemp[i - 1].plus(j).getDouble("x") + t * Vtemp[i - 1].plus(j + 1).getDouble("x")); + (1.0 - t) * Vtemp[i - 1].get(j).x + t * Vtemp[i - 1].get(j + 1).x); Vtemp[i].plus(j).setDouble("y", - (1.0 - t) * Vtemp[i - 1].plus(j).getDouble("y") + t * Vtemp[i - 1].plus(j + 1).getDouble("y")); + (1.0 - t) * Vtemp[i - 1].get(j).y + t * Vtemp[i - 1].get(j + 1).y); } } if (Left != null) @@ -1274,11 +1274,11 @@ private static ST_pointf dotneato_closest_(ST_splines spl, final ST_pointf pt) { besti = bestj = -1; bestdist2 = 1e+38; for (i = 0; i < spl.size; i++) { - bz.____(spl.list.plus(i).getPtr()); + bz.____(spl.list.get(i)); for (j = 0; j < bz.size; j++) { final ST_pointf b = new ST_pointf(); - b.x = bz.list.get(j).getDouble("x"); - b.y = bz.list.get(j).getDouble("y"); + b.x = bz.list.get(j).x; + b.y = bz.list.get(j).y; d2 = DIST2(b, pt); if ((bestj == -1) || (d2 < bestdist2)) { besti = i; @@ -1287,7 +1287,7 @@ private static ST_pointf dotneato_closest_(ST_splines spl, final ST_pointf pt) { } } } - bz.____(spl.list.plus(besti).getPtr()); + bz.____(spl.list.get(besti)); /* Pick best Bezier. If bestj is the last point in the B-spline, decrement. * Then set j to be the first point in the corresponding Bezier by dividing * then multiplying be 3. Thus, 0,1,2 => 0; 3,4,5 => 3, etc. @@ -1296,8 +1296,8 @@ private static ST_pointf dotneato_closest_(ST_splines spl, final ST_pointf pt) { bestj--; j = 3*(bestj / 3); for (k = 0; k < 4; k++) { - c.plus(k).setDouble("x", bz.list.get(j + k).getDouble("x")); - c.plus(k).setDouble("y", bz.list.get(j + k).getDouble("y")); + c.plus(k).setDouble("x", bz.list.get(j + k).x); + c.plus(k).setDouble("y", bz.list.get(j + k).y); } low = 0.0; high = 1.0; @@ -1454,14 +1454,14 @@ try { fi.setPtr("fontcolor", late_nnstring(n, Z.z().N_fontcolor, new CString("black"))); ND_label(n, make_label(n, str, ((aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)) | ( (shapeOf(n) == enumAsInt(shape_kind.class, "SH_RECORD")) ? (2 << 1) : (0 << 1))), - fi.getDouble("fontsize"), fi.fontname, fi.fontcolor)); + fi.fontsize, fi.fontname, fi.fontcolor)); if (Z.z().N_xlabel!=null && (str = agxget(n, Z.z().N_xlabel))!=null && (str.charAt(0)!='\0')) { UNSUPPORTED("4ua9vld76wpovsm1celv2ff6e"); // ND_xlabel(n) = make_label((void*)n, str, (aghtmlstr(str) ? (1 << 1) : (0 << 1)), UNSUPPORTED("b0zm6fkpjlt9jacykbgugjodg"); // fi.fontsize, fi.fontname, fi.fontcolor); UNSUPPORTED("ail0d4qmxj2aqh2q721inwgqu"); // GD_has_labels(agraphof(n)) |= (1 << 4); } ND_showboxes(n, late_int(n, Z.z().N_showboxes, 0, 0)); - ND_shape(n).getPtr("fns").call("initfn", n); + ND_shape(n).fns.initfn.exe(n); } finally { LEAVING("cr81drt18h5feqzxyh3jb0u49","common_init_node"); } @@ -1491,8 +1491,8 @@ LEAVING("d2v8l80y27ue2fag5c0qplah8","initFontEdgeAttr"); public static void initFontLabelEdgeAttr(ST_Agedge_s e, ST_fontinfo fi, ST_fontinfo lfi) { ENTERING("ak3pxrdrq900wymudwnjmbito","initFontLabelEdgeAttr"); try { - if (N(fi.getPtr("fontname"))) initFontEdgeAttr(e, fi); - lfi.setDouble("fontsize", late_double(e, Z.z().E_labelfontsize, fi.getDouble("fontsize"), 1.0)); + if (N(fi.fontname)) initFontEdgeAttr(e, fi); + lfi.setDouble("fontsize", late_double(e, Z.z().E_labelfontsize, fi.fontsize, 1.0)); lfi.setPtr("fontname", late_nnstring(e, Z.z().E_labelfontname, fi.fontname)); lfi.setPtr("fontcolor", late_nnstring(e, Z.z().E_labelfontcolor, fi.fontcolor)); } finally { @@ -1571,7 +1571,7 @@ try { r = 1; initFontEdgeAttr(e, fi); ED_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)), - fi.getDouble("fontsize"), fi.fontname, fi.fontcolor)); + fi.fontsize, fi.fontname, fi.fontcolor)); GD_has_labels(sg, GD_has_labels(sg) | (1 << 0)); ED_label_ontop(e, mapbool(late_string(e, Z.z().E_label_float, new CString("false")))); @@ -1587,13 +1587,13 @@ UNSUPPORTED("c078bypfszv0nsvp1nc0x28wx"); // (((Agraphinfo_t*)(((Agobj_t*)(sg)) if (Z.z().E_headlabel!=null && (str = agxget(e, Z.z().E_headlabel))!=null && (str.charAt(0)!='\0')) { initFontLabelEdgeAttr(e, fi, lfi); ED_head_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)), - lfi.getDouble("fontsize"), lfi.fontname, lfi.fontcolor)); + lfi.fontsize, lfi.fontname, lfi.fontcolor)); GD_has_labels(sg, GD_has_labels(sg) | (1 << 1)); } if (Z.z().E_taillabel!=null && (str = agxget(e, Z.z().E_taillabel))!=null && (str.charAt(0)!='\0')) { initFontLabelEdgeAttr(e, fi, lfi); ED_tail_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)), - lfi.getDouble("fontsize"), lfi.fontname, lfi.fontcolor)); + lfi.fontsize, lfi.fontname, lfi.fontcolor)); GD_has_labels(sg, GD_has_labels(sg) | (1 << 2)); } /* end vladimir */ @@ -1607,7 +1607,7 @@ UNSUPPORTED("c078bypfszv0nsvp1nc0x28wx"); // (((Agraphinfo_t*)(((Agobj_t*)(sg)) if (str!=null && str.charAt(0)!='\0') UNSUPPORTED("j71lo2acx1ydov0uj7xjjce"); // (((Agnodeinfo_t*)(((Agobj_t*)(((((((Agobj_t*)(e))->tag).objtype) == 3?(e):((e)+1))->node)))->data))->has_port) = (!(0)); - ED_tail_port(e, chkPort ((CFunction) ND_shape(agtail(e)).getPtr("fns").getPtr("portfn"), agtail(e), str)); + ED_tail_port(e, chkPort ((CFunction) ND_shape(agtail(e)).fns.portfn, agtail(e), str)); if (noClip(e, Z.z().E_tailclip)) UNSUPPORTED("cg4z67u0dm6h9nrcx8kkalnlt"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->tail_port).clip = 0; str = agget(e, new CString("headport")); @@ -1616,7 +1616,7 @@ UNSUPPORTED("cg4z67u0dm6h9nrcx8kkalnlt"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))- if (str!=null && str.charAt(0)!='\0') UNSUPPORTED("542y57dbsosmjvsmdnzon2qb5"); // (((Agnodeinfo_t*)(((Agobj_t*)(((((((Agobj_t*)(e))->tag).objtype) == 2?(e):((e)-1))->node)))->data))->has_port) = (!(0)); - ED_head_port(e, chkPort((CFunction) ND_shape(aghead(e)).getPtr("fns").getPtr("portfn"), aghead(e), str)); + ED_head_port(e, chkPort((CFunction) ND_shape(aghead(e)).fns.portfn, aghead(e), str)); if (noClip(e, Z.z().E_headclip)) UNSUPPORTED("ayqscz30ekhcje94wh4ib1hcu"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->head_port).clip = 0; @@ -1640,24 +1640,24 @@ ENTERING("3mkqvtbyq9j8ktzil6t7vakg5","addLabelBB"); try { double width, height; final ST_pointf p = new ST_pointf(); - p.___(lp.getStruct("pos")); + p.___(lp.pos); double min, max; if (flipxy) { - height = lp.dimen.getDouble("x"); - width = lp.dimen.getDouble("y"); + height = lp.dimen.x; + width = lp.dimen.y; } else { - width = lp.dimen.getDouble("x"); - height = lp.dimen.getDouble("y"); + width = lp.dimen.x; + height = lp.dimen.y; } - min = p.getDouble("x") - width / 2.; - max = p.getDouble("x") + width / 2.; + min = p.x - width / 2.; + max = p.x + width / 2.; if (min < bb.LL.x) bb.LL.x = min; if (max > bb.UR.x) bb.UR.x = max; - min = p.getDouble("y") - height / 2.; - max = p.getDouble("y") + height / 2.; + min = p.y - height / 2.; + max = p.y + height / 2.; if (min < bb.LL.y) bb.LL.y = min; if (max > bb.UR.y) diff --git a/src/gen/lib/dotgen/acyclic__c.java b/src/gen/lib/dotgen/acyclic__c.java index e0743605a..1271f4c3c 100644 --- a/src/gen/lib/dotgen/acyclic__c.java +++ b/src/gen/lib/dotgen/acyclic__c.java @@ -389,8 +389,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/dotgen/aspect__c.java b/src/gen/lib/dotgen/aspect__c.java index ca7622bf0..5eeca97f9 100644 --- a/src/gen/lib/dotgen/aspect__c.java +++ b/src/gen/lib/dotgen/aspect__c.java @@ -379,8 +379,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/dotgen/class1__c.java b/src/gen/lib/dotgen/class1__c.java index a8a95baaa..8f6197664 100644 --- a/src/gen/lib/dotgen/class1__c.java +++ b/src/gen/lib/dotgen/class1__c.java @@ -403,8 +403,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/dotgen/class2__c.java b/src/gen/lib/dotgen/class2__c.java index d915f6a10..daf25260e 100644 --- a/src/gen/lib/dotgen/class2__c.java +++ b/src/gen/lib/dotgen/class2__c.java @@ -427,8 +427,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -736,11 +736,11 @@ try { ND_lw(v, GD_nodesep(agroot(v))); if (N(ED_label_ontop(orig))) { if (GD_flip(agroot(g))!=0) { - ND_ht(v, dimen.getDouble("x")); - ND_rw(v, dimen.getDouble("y")); + ND_ht(v, dimen.x); + ND_rw(v, dimen.y); } else { - ND_ht(v, dimen.getDouble("y")); - ND_rw(v, dimen.getDouble("x")); + ND_ht(v, dimen.y); + ND_rw(v, dimen.x); } } return v; @@ -954,7 +954,7 @@ try { GD_n_nodes(g, 0); /* new */ mark_clusters(g); for (c = 1; c <= GD_n_cluster(g); c++) - build_skeleton(g, (ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); + build_skeleton(g, (ST_Agraph_s) GD_clust(g).get(c).getPtr()); for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) for (e = agfstout(g, n); e!=null; e = agnxtout(g, e)) { if (ND_weight_class(aghead(e)) <= 2) diff --git a/src/gen/lib/dotgen/cluster__c.java b/src/gen/lib/dotgen/cluster__c.java index ba42cb86e..a093d71f9 100644 --- a/src/gen/lib/dotgen/cluster__c.java +++ b/src/gen/lib/dotgen/cluster__c.java @@ -438,8 +438,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -760,27 +760,27 @@ ENTERING("5ib4nnt2ah5fdd22zs0xds29r","make_slots"); try { int i; ST_Agnode_s v; - __ptr__ vlist; - vlist = GD_rank(root).plus(r).getPtr().v.asPtr(); + ST_Agnode_s.ArrayOfStar vlist; + vlist = GD_rank(root).get(r).v; if (d <= 0) { - for (i = pos - d + 1; i < GD_rank(root).plus(r).getInt("n"); i++) { - v = (ST_Agnode_s) vlist.plus(i).getPtr(); + for (i = pos - d + 1; i < GD_rank(root).get(r).n; i++) { + v = (ST_Agnode_s) vlist.get(i); ND_order(v, i + d - 1); vlist.plus(ND_order(v)).setPtr(v); } - for (i = GD_rank(root).plus(r).getInt("n") + d - 1; i < GD_rank(root).plus(r).getInt("n"); i++) + for (i = GD_rank(root).get(r).n + d - 1; i < GD_rank(root).get(r).n; i++) vlist.plus(i).setPtr(null); } else { /*assert(ND_rank(root)[r].n + d - 1 <= ND_rank(root)[r].an);*/ - for (i = GD_rank(root).plus(r).getPtr().getInt("n") - 1; i > pos; i--) { - v = (ST_Agnode_s) vlist.plus(i).getPtr(); + for (i = GD_rank(root).get(r).n - 1; i > pos; i--) { + v = (ST_Agnode_s) vlist.get(i); ND_order(v, i + d - 1); vlist.plus(ND_order(v)).setPtr(v); } for (i = pos + 1; i < pos + d; i++) vlist.plus(i).setPtr(null); } - GD_rank(root).plus(r).getPtr().setInt("n", GD_rank(root).plus(r).getPtr().getInt("n") + d - 1); + GD_rank(root).get(r).setInt("n", GD_rank(root).get(r).n + d - 1); } finally { LEAVING("5ib4nnt2ah5fdd22zs0xds29r","make_slots"); } @@ -994,12 +994,12 @@ try { if (GD_minrank(subg) > 0) GD_rank(root).plus(GD_minrank(subg) - 1).getPtr().setInt("valid", 0); for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) { - d = GD_rank(subg).plus(r).getPtr().getInt("n"); - ipos = pos = ND_order(GD_rankleader(subg).plus(r).getPtr()); + d = GD_rank(subg).get(r).n; + ipos = pos = ND_order(GD_rankleader(subg).get(r)); make_slots(root, r, pos, d); - for (i = 0; i < GD_rank(subg).plus(r).getPtr().getInt("n"); i++) { - v = (ST_Agnode_s) GD_rank(subg).plus(r).getPtr().v.plus(i).getPtr(); - GD_rank(root).plus(r).getPtr().v.plus(pos).setPtr(v); + for (i = 0; i < GD_rank(subg).get(r).n; i++) { + v = (ST_Agnode_s) GD_rank(subg).get(r).v.get(i); + GD_rank(root).get(r).v.plus(pos).setPtr(v); ND_order(v, pos++); /* real nodes automatically have v->root = root graph */ if (ND_node_type(v) == 1) @@ -1008,11 +1008,11 @@ try { fast_node(root, v); GD_n_nodes(root, GD_n_nodes(root)+1); } - GD_rank(subg).plus(r).getPtr().setPtr("v", GD_rank(root).plus(r).getPtr().getPtr("v").plus(ipos)); - GD_rank(root).plus(r).getPtr().setInt("valid", 0); + GD_rank(subg).get(r).setPtr("v", GD_rank(root).get(r).v.plus(ipos)); + GD_rank(root).get(r).setInt("valid", 0); } if (r < GD_maxrank(root)) - GD_rank(root).plus(r).getPtr().setInt("valid", 0); + GD_rank(root).get(r).setInt("valid", 0); GD_expanded(subg, NOT(false)); } finally { LEAVING("85nhs7tnmwunw0fsjj1kxao7l","merge_ranks"); @@ -1031,7 +1031,7 @@ try { ST_Agnode_s v; ST_Agedge_s e; for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { - v = (ST_Agnode_s) GD_rankleader(g).plus(r).getPtr(); + v = (ST_Agnode_s) GD_rankleader(g).get(r); /* remove the entire chain */ while ((e = (ST_Agedge_s) ND_out(v).getFromList(0))!=null) delete_fast_edge(e); @@ -1088,7 +1088,7 @@ try { ND_clust(n, null); } for (c = 1; c <= GD_n_cluster(g); c++) { - clust = (ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(); + clust = (ST_Agraph_s) GD_clust(g).get(c).getPtr(); for (n = agfstnode(clust); n!=null; n = nn) { nn = agnxtnode(clust,n); if (ND_ranktype(n) != 0) { @@ -1156,7 +1156,7 @@ try { } } for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) { - rl = (ST_Agnode_s) GD_rankleader(subg).plus(r).getPtr(); + rl = (ST_Agnode_s) GD_rankleader(subg).get(r); if (ND_UF_size(rl) > 1) ND_UF_size(rl, ND_UF_size(rl)-1); } @@ -1178,9 +1178,9 @@ try { clust = ND_clust(n); if (GD_installed(clust) != pass + 1) { for (r = GD_minrank(clust); r <= GD_maxrank(clust); r++) - install_in_rank(g, (ST_Agnode_s) GD_rankleader(clust).plus(r).getPtr()); + install_in_rank(g, (ST_Agnode_s) GD_rankleader(clust).get(r)); for (r = GD_minrank(clust); r <= GD_maxrank(clust); r++) - enqueue_neighbors(q, (ST_Agnode_s) GD_rankleader(clust).plus(r).getPtr(), pass); + enqueue_neighbors(q, (ST_Agnode_s) GD_rankleader(clust).get(r), pass); GD_installed(clust, pass + 1); } } finally { @@ -1230,7 +1230,7 @@ try { ST_Agedge_s orig, e; int c; for (c = 1; c <= GD_n_cluster(g); c++) { - clust = (ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(); + clust = (ST_Agraph_s) GD_clust(g).get(c).getPtr(); mark_lowcluster_basic(clust); } /* see what belongs to this graph that wasn't already marked */ diff --git a/src/gen/lib/dotgen/compound__c.java b/src/gen/lib/dotgen/compound__c.java index 498541023..5cd594e5d 100644 --- a/src/gen/lib/dotgen/compound__c.java +++ b/src/gen/lib/dotgen/compound__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/dotgen/conc__c.java b/src/gen/lib/dotgen/conc__c.java index 936354f76..d027092eb 100644 --- a/src/gen/lib/dotgen/conc__c.java +++ b/src/gen/lib/dotgen/conc__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/dotgen/decomp__c.java b/src/gen/lib/dotgen/decomp__c.java index 2e1587a23..c4595cf89 100644 --- a/src/gen/lib/dotgen/decomp__c.java +++ b/src/gen/lib/dotgen/decomp__c.java @@ -398,8 +398,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/dotgen/dotinit__c.java b/src/gen/lib/dotgen/dotinit__c.java index 1c14c9711..a854ef17b 100644 --- a/src/gen/lib/dotgen/dotinit__c.java +++ b/src/gen/lib/dotgen/dotinit__c.java @@ -102,11 +102,11 @@ import static smetana.core.Macro.ND_out; import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.alloc_elist; import h.ST_Agedge_s; +import h.ST_Agedgeinfo_t; import h.ST_Agnode_s; +import h.ST_Agnodeinfo_t; import h.ST_Agraph_s; import h.ST_Agraphinfo_t; -import h.ST_Agedgeinfo_t; -import h.ST_Agnodeinfo_t; import h.ST_aspect_t; import h.ST_pack_info; import h.ST_pointf; @@ -440,8 +440,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -1080,8 +1080,8 @@ UNSUPPORTED("28kbszyxsjoj03gb134ov4hag"); // aspect.nextIter = 0; attach_phase_attrs (g, 2); /* positions will be attached on output */ return; } - aspect.setInt("nPasses", aspect.getInt("nPasses") -1); - } while (aspect.getInt("nextIter")!=0 && aspect.getInt("nPasses")!=0); + aspect.setInt("nPasses", aspect.nPasses -1); + } while (aspect.nextIter!=0 && aspect.nPasses!=0); if ((GD_flags(g) & (1 << 4))!=0) removeFill (g); dot_sameports(g); diff --git a/src/gen/lib/dotgen/dotsplines__c.java b/src/gen/lib/dotgen/dotsplines__c.java index b9ca6061c..f390a6cfe 100644 --- a/src/gen/lib/dotgen/dotsplines__c.java +++ b/src/gen/lib/dotgen/dotsplines__c.java @@ -486,8 +486,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -897,10 +897,10 @@ try { } new_.setPtr("list", list); new_.setInt("size", sz); - new_.setInt("sflag", old.getInt("eflag")); - new_.setInt("eflag", old.getInt("sflag")); - new_.setStruct("sp", old.getStruct("ep")); - new_.setStruct("ep", old.getStruct("sp")); + new_.setInt("sflag", old.getStruct().eflag); + new_.setInt("eflag", old.getStruct().sflag); + new_.setStruct("sp", old.getStruct().ep); + new_.setStruct("ep", old.getStruct().sp); } finally { LEAVING("10wbtt4gwnxgqutinpj4ymjpk","swap_bezier"); } @@ -918,7 +918,7 @@ try { ST_bezier.Array2 lp; ST_bezier.Array2 olp; int i, sz; - sz = s.getInt("size"); + sz = s.size; list = new ST_bezier.Array2(sz); lp = list; olp = s.list.plus(sz - 1); @@ -929,7 +929,7 @@ try { } /* free old structures */ for (i = 0; i < sz; i++) - Memory.free(((ST_bezier)s.list.plus(i).getPtr()).getPtr().list); + Memory.free(((ST_bezier)s.list.get(i)).getPtr().list); Memory.free(s.list); s.list = (ST_bezier.Array2) list; } finally { @@ -949,7 +949,7 @@ try { ST_Agnode_s n; for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) { for (e = agfstout(g, n); e!=null; e = agnxtout(g, e)) { - if ((Boolean)Z.z().sinfo.call("swapEnds", e) && ED_spl(e)!=null) + if ((Boolean)Z.z().sinfo.swapEnds.exe(e) && ED_spl(e)!=null) swap_spline(ED_spl(e)); } } @@ -1056,15 +1056,15 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish; sd.setInt("LeftBound", 0); n_edges = n_nodes = 0; for (i = GD_minrank(g); i <= GD_maxrank(g); i++) { - n_nodes += GD_rank(g).plus(i).getInt("n"); - if ((n = (ST_Agnode_s) GD_rank(g).plus(i).getPtr().v.plus(0).getPtr())!=null) - sd.setInt("LeftBound", (int)MIN(sd.getInt("LeftBound"), (ND_coord(n).getDouble("x") - ND_lw(n)))); - if (GD_rank(g).plus(i).getInt("n")!=0 && (n = (ST_Agnode_s) GD_rank(g).plus(i).getPtr().v.plus(GD_rank(g).plus(i).getInt("n") - 1).getPtr())!=null) - sd.setInt("RightBound", (int)MAX(sd.getInt("RightBound"), (ND_coord(n).getDouble("x") + ND_rw(n)))); - sd.setInt("LeftBound", sd.getInt("LeftBound") - 16); - sd.setInt("RightBound", sd.getInt("RightBound") + 16); - for (j = 0; j < GD_rank(g).plus(i).getInt("n"); j++) { - n = (ST_Agnode_s) GD_rank(g).plus(i).getPtr().v.plus(j).getPtr(); + n_nodes += GD_rank(g).get(i).n; + if ((n = (ST_Agnode_s) GD_rank(g).get(i).v.get(0))!=null) + sd.setInt("LeftBound", (int)MIN(sd.LeftBound, (ND_coord(n).x - ND_lw(n)))); + if (GD_rank(g).get(i).n!=0 && (n = (ST_Agnode_s) GD_rank(g).get(i).v.plus(GD_rank(g).get(i).n - 1).getPtr())!=null) + sd.setInt("RightBound", (int)MAX(sd.RightBound, (ND_coord(n).x + ND_rw(n)))); + sd.setInt("LeftBound", sd.LeftBound - 16); + sd.setInt("RightBound", sd.RightBound + 16); + for (j = 0; j < GD_rank(g).get(i).n; j++) { + n = (ST_Agnode_s) GD_rank(g).get(i).v.get(j); /* if n is the label of a flat edge, copy its position to * the label. */ @@ -1075,7 +1075,7 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish; ED_label(fe).set= NOTI(false); } if ((ND_node_type(n) != 0) && - ((Boolean)Z.z().sinfo.call("splineMerge", n) == false)) + ((Boolean)Z.z().sinfo.splineMerge.exe(n) == false)) continue; for (k = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(k))!=null; k++) { if ((ED_edge_type(e) == 4) @@ -1150,7 +1150,7 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish; ea = (ST_Agedge_s) fwdedgea.out; } for (cnt = 1; i < n_edges; cnt++, i++) { - if (NEQ(le0, (le1 = getmainedge((e1 = (ST_Agedge_s) edges.plus(i).getPtr()))))) + if (NEQ(le0, (le1 = getmainedge((e1 = (ST_Agedge_s) edges.get(i)))))) break; if (ED_adjacent(e0)!=0) continue; /* all flat adjacent edges at once */ if (ED_tail_port(e1).defined!=0 || ED_head_port(e1).defined!=0) { @@ -1173,7 +1173,7 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish; if ((ED_tree_index(e0) & 15) == 2 && NEQ(ED_label(e0), ED_label(e1))) break; - if ((ED_tree_index(edges.plus(i).getPtr()) & 64)!=0) /* Aha! -C is on */ + if ((ED_tree_index(edges.get(i)) & 64)!=0) /* Aha! -C is on */ break; } if (EQ(agtail(e0), aghead(e0))) { @@ -1182,19 +1182,19 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish; r = ND_rank(n); if (r == GD_maxrank(g)) { if (r > 0) - sizey = (int) (ND_coord(GD_rank(g).plus(r-1).getPtr().v.plus(0).getPtr()).getDouble("y") - ND_coord(n).getDouble("y")); + sizey = (int) (ND_coord(GD_rank(g).get(r-1).v.get(0)).y - ND_coord(n).y); else sizey = (int) ND_ht(n); } else if (r == GD_minrank(g)) { - sizey = (int)(ND_coord(n).getDouble("y") - ND_coord(GD_rank(g).plus(r+1).getPtr().v.plus(0).getPtr()).getDouble("y")); + sizey = (int)(ND_coord(n).y - ND_coord(GD_rank(g).get(r+1).v.get(0)).y); } else { - int upy = (int) (ND_coord(GD_rank(g).plus(r-1).getPtr().v.plus(0).getPtr()).getDouble("y") - ND_coord(n).getDouble("y")); - int dwny = (int) (ND_coord(n).getDouble("y") - ND_coord(GD_rank(g).plus(r+1).getPtr().v.plus(0).getPtr()).getDouble("y")); + int upy = (int) (ND_coord(GD_rank(g).get(r-1).v.get(0)).y - ND_coord(n).y); + int dwny = (int) (ND_coord(n).y - ND_coord(GD_rank(g).get(r+1).v.get(0)).y); sizey = MIN(upy, dwny); } - makeSelfEdge(P, edges, ind, cnt, sd.getInt("Multisep"), sizey/2, Z.z().sinfo); + makeSelfEdge(P, edges, ind, cnt, sd.Multisep, sizey/2, Z.z().sinfo); for (b = 0; b < cnt; b++) { e = (ST_Agedge_s) edges.plus(ind+b).getPtr(); if (ED_label(e)!=null) @@ -1285,9 +1285,9 @@ try { for (e = (ST_Agedge_s) ND_out(n).getFromList(0); ED_edge_type(e) != 0; e = ED_to_orig(e)); dimen.___(ED_label(e).dimen); - width = GD_flip(agraphof(n))!=0 ? dimen.getDouble("y") : dimen.getDouble("x"); - ED_label(e).getStruct("pos").setDouble("x", ND_coord(n).getDouble("x") + width / 2.0); - ED_label(e).getStruct("pos").setDouble("y", ND_coord(n).getDouble("y")); + width = GD_flip(agraphof(n))!=0 ? dimen.y : dimen.x; + ED_label(e).pos.setDouble("x", ND_coord(n).x + width / 2.0); + ED_label(e).pos.setDouble("y", ND_coord(n).y); ED_label(e).set= NOTI(false); } finally { LEAVING("8jja9ukzsq8tlb9yy7uzavg91","place_vnlabel"); @@ -1361,8 +1361,8 @@ try { v1 = ABS((int)t1); if (v0 != v1) return (v0 - v1); - t0 = ND_coord(agtail(le0)).getDouble("x") - ND_coord(aghead(le0)).getDouble("x"); - t1 = ND_coord(agtail(le1)).getDouble("x") - ND_coord(aghead(le1)).getDouble("x"); + t0 = ND_coord(agtail(le0)).x - ND_coord(aghead(le0)).x; + t1 = ND_coord(agtail(le1)).x - ND_coord(aghead(le1)).x; v0 = ABS((int)t0); v1 = ABS((int)t1); if (v0 != v1) @@ -1680,10 +1680,10 @@ try { if (ED_label(e1)!=null) { sz0.___(ED_label(e0).dimen); sz1.___(ED_label(e1).dimen); - if (sz0.getDouble("x") > sz1.getDouble("x")) return -1; - else if (sz0.getDouble("x") < sz1.getDouble("x")) return 1; - else if (sz0.getDouble("y") > sz1.getDouble("y")) return -1; - else if (sz0.getDouble("y") < sz1.getDouble("y")) return 1; + if (sz0.x > sz1.x) return -1; + else if (sz0.x < sz1.x) return 1; + else if (sz0.y > sz1.y) return -1; + else if (sz0.y < sz1.y) return 1; else return 0; } else @@ -1704,69 +1704,69 @@ LEAVING("bmsa24i3avg14po4sp17yh89k","edgelblcmpfn"); //3 3xmylrnypvoqrj2yrxnomsj5k // static void makeSimpleFlatLabels (node_t* tn, node_t* hn, edge_t** edges, int ind, int cnt, int et, int n_lbls) -public static void makeSimpleFlatLabels(ST_Agnode_s tn, ST_Agnode_s hn, __ptr__ edges, int ind, int cnt, int et, int n_lbls) { +public static void makeSimpleFlatLabels(ST_Agnode_s tn, ST_Agnode_s hn, ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, int et, int n_lbls) { ENTERING("3xmylrnypvoqrj2yrxnomsj5k","makeSimpleFlatLabels"); try { ST_pointf.Array ps; final ST_Ppoly_t poly = new ST_Ppoly_t(); int pn[] = new int[1]; - ST_Agedge_s e = (ST_Agedge_s) edges.plus(ind).getPtr(); + ST_Agedge_s e = (ST_Agedge_s) edges.get(ind); final ST_pointf.Array points = new ST_pointf.Array(10); final ST_pointf tp = new ST_pointf(), hp = new ST_pointf(); int i, pointn; double leftend, rightend, ctrx=0, ctry=0, miny, maxy; double uminx=0, umaxx=0; double lminx=0, lmaxx=0; - __ptr__ earray = new ST_Agedge_s.ArrayOfStar(cnt); + ST_Agedge_s.ArrayOfStar earray = new ST_Agedge_s.ArrayOfStar(cnt); for (i = 0; i < cnt; i++) { earray.plus(i).setPtr(edges.plus(ind + i).getPtr()); } qsort(earray, cnt, function(dotsplines__c.class, "edgelblcmpfn")); - tp.___(add_pointf(ND_coord(tn), (ST_pointf) ED_tail_port(e).getStruct("p"))); - hp.___(add_pointf(ND_coord(hn), (ST_pointf) ED_head_port(e).getStruct("p"))); - leftend = tp.getDouble("x")+ND_rw(tn); - rightend = hp.getDouble("x")-ND_lw(hn); + tp.___(add_pointf(ND_coord(tn), (ST_pointf) ED_tail_port(e).p)); + hp.___(add_pointf(ND_coord(hn), (ST_pointf) ED_head_port(e).p)); + leftend = tp.x+ND_rw(tn); + rightend = hp.x-ND_lw(hn); ctrx = (leftend + rightend)/2.0; /* do first edge */ - e = (ST_Agedge_s) earray.plus(0).getPtr(); + e = (ST_Agedge_s) earray.get(0); pointn = 0; points.plus(pointn++).setStruct(tp); points.plus(pointn++).setStruct(tp); points.plus(pointn++).setStruct(hp); points.plus(pointn++).setStruct(hp); clip_and_install(e, aghead(e), points.asPtr(), pointn, Z.z().sinfo); - ED_label(e).getStruct("pos").setDouble("x", ctrx); - ED_label(e).getStruct("pos").setDouble("y", tp.getDouble("y") + (ED_label(e).dimen.getDouble("y")+6)/2.0); + ED_label(e).pos.setDouble("x", ctrx); + ED_label(e).pos.setDouble("y", tp.y + (ED_label(e).dimen.y+6)/2.0); ED_label(e).set= NOTI(false); - miny = tp.getDouble("y") + 6/2.0; - maxy = miny + ED_label(e).dimen.getDouble("y"); - uminx = ctrx - (ED_label(e).dimen.getDouble("x"))/2.0; - umaxx = ctrx + (ED_label(e).dimen.getDouble("x"))/2.0; + miny = tp.y + 6/2.0; + maxy = miny + ED_label(e).dimen.y; + uminx = ctrx - (ED_label(e).dimen.x)/2.0; + umaxx = ctrx + (ED_label(e).dimen.x)/2.0; for (i = 1; i < n_lbls; i++) { - e = (ST_Agedge_s) earray.plus(i).getPtr(); + e = (ST_Agedge_s) earray.get(i); if (i%2!=0) { /* down */ if (i == 1) { - lminx = ctrx - (ED_label(e).dimen.getDouble("x"))/2.0; - lmaxx = ctrx + (ED_label(e).dimen.getDouble("x"))/2.0; + lminx = ctrx - (ED_label(e).dimen.x)/2.0; + lmaxx = ctrx + (ED_label(e).dimen.x)/2.0; } - miny -= 6 + ED_label(e).dimen.getDouble("y"); + miny -= 6 + ED_label(e).dimen.y; points.plus(0).setStruct(tp); - points.plus(1).setDouble("x", tp.getDouble("x")); + points.plus(1).setDouble("x", tp.x); points.plus(1).setDouble("y", miny - 6); - points.plus(2).setDouble("x", hp.getDouble("x")); - points.plus(2).setDouble("y", points.plus(1).getDouble("y")); + points.plus(2).setDouble("x", hp.x); + points.plus(2).setDouble("y", points.get(1).y); points.plus(3).setStruct(hp); points.plus(4).setDouble("x", lmaxx); - points.plus(4).setDouble("y", hp.getDouble("y")); + points.plus(4).setDouble("y", hp.y); points.plus(5).setDouble("x", lmaxx); points.plus(5).setDouble("y", miny); points.plus(6).setDouble("x", lminx); points.plus(6).setDouble("y", miny); points.plus(7).setDouble("x", lminx); - points.plus(7).setDouble("y", tp.getDouble("y")); - ctry = miny + (ED_label(e).dimen.getDouble("y"))/2.0; + points.plus(7).setDouble("y", tp.y); + ctry = miny + (ED_label(e).dimen.y)/2.0; } else { /* up */ UNSUPPORTED("7owdudualx55z2cnm9x3iio0w"); // points[0] = tp; @@ -1791,14 +1791,14 @@ UNSUPPORTED("e2zgxycgqefryde9nbv6cqz1u"); // maxy += ED_label(e)->dimen.y + poly.ps = points; ps = simpleSplineRoute (tp, hp, poly, pn, et == (3 << 1)); if (pn[0] == 0) return; - ED_label(e).getStruct("pos").setDouble("x", ctrx); - ED_label(e).getStruct("pos").setDouble("y", ctry); + ED_label(e).pos.setDouble("x", ctrx); + ED_label(e).pos.setDouble("y", ctry); ED_label(e).set= NOTI(false); clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo); } /* edges with no labels */ for (; i < cnt; i++) { - e = (ST_Agedge_s) earray.plus(i).getPtr(); + e = (ST_Agedge_s) earray.get(i); if (i%2!=0) { /* down */ if (i == 1) { lminx = (2*leftend + rightend)/3.0; @@ -1806,19 +1806,19 @@ UNSUPPORTED("e2zgxycgqefryde9nbv6cqz1u"); // maxy += ED_label(e)->dimen.y + } miny -= 6; points.plus(0).setStruct(tp); - points.plus(1).setDouble("x", tp.getDouble("x")); + points.plus(1).setDouble("x", tp.x); points.plus(1).setDouble("y", miny - 6); - points.plus(2).setDouble("x", hp.getDouble("x")); - points.plus(2).setDouble("y", points.plus(1).getDouble("y")); + points.plus(2).setDouble("x", hp.x); + points.plus(2).setDouble("y", points.get(1).y); points.plus(3).setStruct(hp); points.plus(4).setDouble("x", lmaxx); - points.plus(4).setDouble("y", hp.getDouble("y")); + points.plus(4).setDouble("y", hp.y); points.plus(5).setDouble("x", lmaxx); points.plus(5).setDouble("y", miny); points.plus(6).setDouble("x", lminx); points.plus(6).setDouble("y", miny); points.plus(7).setDouble("x", lminx); - points.plus(7).setDouble("y", tp.getDouble("y")); + points.plus(7).setDouble("y", tp.y); } else { /* up */ UNSUPPORTED("7owdudualx55z2cnm9x3iio0w"); // points[0] = tp; @@ -1855,25 +1855,25 @@ LEAVING("3xmylrnypvoqrj2yrxnomsj5k","makeSimpleFlatLabels"); //3 8kqyzk43ovc2sq6jegua6ytp // static void makeSimpleFlat (node_t* tn, node_t* hn, edge_t** edges, int ind, int cnt, int et) -public static void makeSimpleFlat(ST_Agnode_s tn, ST_Agnode_s hn, __ptr__ edges, int ind, int cnt, int et) { +public static void makeSimpleFlat(ST_Agnode_s tn, ST_Agnode_s hn, ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, int et) { ENTERING("8kqyzk43ovc2sq6jegua6ytp","makeSimpleFlat"); try { - ST_Agedge_s e = (ST_Agedge_s) edges.plus(ind).getPtr(); + ST_Agedge_s e = (ST_Agedge_s) edges.get(ind); final ST_pointf.Array points = new ST_pointf.Array( 10); final ST_pointf tp = new ST_pointf(), hp = new ST_pointf(); int i, pointn; double stepy, dy; - tp.___(add_pointf(ND_coord(tn), (ST_pointf) ED_tail_port(e).getStruct("p"))); - hp.___(add_pointf(ND_coord(hn), (ST_pointf) ED_head_port(e).getStruct("p"))); + tp.___(add_pointf(ND_coord(tn), (ST_pointf) ED_tail_port(e).p)); + hp.___(add_pointf(ND_coord(hn), (ST_pointf) ED_head_port(e).p)); stepy = (cnt > 1) ? ND_ht(tn) / (double)(cnt - 1) : 0.; - dy = tp.getDouble("y") - ((cnt > 1) ? ND_ht(tn) / 2. : 0.); + dy = tp.y - ((cnt > 1) ? ND_ht(tn) / 2. : 0.); for (i = 0; i < cnt; i++) { e = (ST_Agedge_s) edges.plus(ind + i).getPtr(); pointn = 0; if ((et == (5 << 1)) || (et == (1 << 1))) { points.plus(pointn++).setStruct(tp); - points.plus(pointn++).setStruct(pointfof((2 * tp.getDouble("x") + hp.getDouble("x")) / 3, dy)); - points.plus(pointn++).setStruct(pointfof((2 * hp.getDouble("x") + tp.getDouble("x")) / 3, dy)); + points.plus(pointn++).setStruct(pointfof((2 * tp.x + hp.x) / 3, dy)); + points.plus(pointn++).setStruct(pointfof((2 * hp.x + tp.x) / 3, dy)); points.plus(pointn++).setStruct(hp); } else { /* ET_PLINE */ @@ -1901,7 +1901,7 @@ LEAVING("8kqyzk43ovc2sq6jegua6ytp","makeSimpleFlat"); //3 bhnjospwghq4plid12757c928 // static void make_flat_adj_edges(graph_t* g, path* P, edge_t** edges, int ind, int cnt, edge_t* e0, int et) -public static void make_flat_adj_edges(ST_Agraph_s g, ST_path P, __ptr__ edges, int ind, int cnt, ST_Agedge_s e0, int et) { +public static void make_flat_adj_edges(ST_Agraph_s g, ST_path P, ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, ST_Agedge_s e0, int et) { ENTERING("bhnjospwghq4plid12757c928","make_flat_adj_edges"); try { ST_Agnode_s n; @@ -2053,9 +2053,9 @@ try { endp.setInt("sidemask", 1<<2); if (isBegin) beginpath(P, e, 2, endp, false); else endpath(P, e, 2, endp, false); - b.UR.y = endp.boxes[endp.getInt("boxn") - 1].UR.y; - b.LL.y = endp.boxes[endp.getInt("boxn") - 1].LL.y; - b.___(makeregularend((ST_boxf) b, (1<<2), ND_coord(n).getDouble("y") + GD_rank(g).plus(ND_rank(n)).getDouble("ht2"))); + b.UR.y = endp.boxes[endp.boxn - 1].UR.y; + b.LL.y = endp.boxes[endp.boxn - 1].LL.y; + b.___(makeregularend((ST_boxf) b, (1<<2), ND_coord(n).y + GD_rank(g).get(ND_rank(n)).ht2)); if (b.LL.x < b.UR.x && b.LL.y < b.UR.y) UNSUPPORTED("cmjm4y40vf7wklmgz0ae4k36v"); // endp->boxes[endp->boxn++] = b; } finally { @@ -2123,34 +2123,34 @@ UNSUPPORTED("68ojpcos92c96bc0i5ag1yb6v"); // ps = points; UNSUPPORTED("1uunj4jbr2uhiqxwor6rzmr3j"); // pn = 7; } else { - lb.LL.x = ND_coord(ln).getDouble("x") - ND_lw(ln); - lb.UR.x = ND_coord(ln).getDouble("x") + ND_rw(ln); - lb.UR.y = ND_coord(ln).getDouble("y") + ND_ht(ln)/2; - ydelta = (int)(ND_coord(ln).getDouble("y") - GD_rank(g).plus(ND_rank(tn)).getDouble("ht1") - - ND_coord(tn).getDouble("y") + GD_rank(g).plus(ND_rank(tn)).getDouble("ht2")); + lb.LL.x = ND_coord(ln).x - ND_lw(ln); + lb.UR.x = ND_coord(ln).x + ND_rw(ln); + lb.UR.y = ND_coord(ln).y + ND_ht(ln)/2; + ydelta = (int)(ND_coord(ln).y - GD_rank(g).get(ND_rank(tn)).ht1 - + ND_coord(tn).y + GD_rank(g).get(ND_rank(tn)).ht2); ydelta = (int)(ydelta / 6.); lb.LL.y = lb.UR.y - MAX(5.,ydelta); boxn = 0; makeFlatEnd (g, sp, P, tn, e, tend, NOT(false)); makeFlatEnd (g, sp, P, hn, e, hend, false); - ((Z.z().boxes[boxn])).LL.x = (tend).boxes[tend.getInt("boxn") - 1].LL.x; - ((Z.z().boxes[boxn])).LL.y = (tend).boxes[tend.getInt("boxn") - 1].UR.y; + ((Z.z().boxes[boxn])).LL.x = (tend).boxes[tend.boxn - 1].LL.x; + ((Z.z().boxes[boxn])).LL.y = (tend).boxes[tend.boxn - 1].UR.y; ((Z.z().boxes[boxn])).UR.x = lb.LL.x; ((Z.z().boxes[boxn])).UR.y = lb.LL.y; boxn++; - ((Z.z().boxes[boxn])).LL.x = (tend).boxes[tend.getInt("boxn") - 1].LL.x; + ((Z.z().boxes[boxn])).LL.x = (tend).boxes[tend.boxn - 1].LL.x; ((Z.z().boxes[boxn])).LL.y = lb.LL.y; - ((Z.z().boxes[boxn])).UR.x = (hend).boxes[hend.getInt("boxn") - 1].UR.x; + ((Z.z().boxes[boxn])).UR.x = (hend).boxes[hend.boxn - 1].UR.x; ((Z.z().boxes[boxn])).UR.y = lb.UR.y; boxn++; ((Z.z().boxes[boxn])).LL.x = lb.UR.x; ((Z.z().boxes[boxn])).UR.y = lb.LL.y; - ((Z.z().boxes[boxn])).LL.y = (hend).boxes[hend.getInt("boxn") - 1].UR.y; - ((Z.z().boxes[boxn])).UR.x = (hend).boxes[hend.getInt("boxn") - 1].UR.x; + ((Z.z().boxes[boxn])).LL.y = (hend).boxes[hend.boxn - 1].UR.y; + ((Z.z().boxes[boxn])).UR.x = (hend).boxes[hend.boxn - 1].UR.x; boxn++; - for (i = 0; i < tend.getInt("boxn"); i++) add_box(P, (tend).boxes[i]); + for (i = 0; i < tend.boxn; i++) add_box(P, (tend).boxes[i]); for (i = 0; i < boxn; i++) add_box(P, Z.z().boxes[i]); - for (i = hend.getInt("boxn") - 1; i >= 0; i--) add_box(P, (hend).boxes[i]); + for (i = hend.boxn - 1; i >= 0; i--) add_box(P, (hend).boxes[i]); if (et == (5 << 1)) ps = routesplines(P, pn); else ps = routepolylines(P, pn); if (pn[0] == 0) return; @@ -2235,7 +2235,7 @@ throw new UnsupportedOperationException(); //3 6yr3jfkljl5w0z6dv354ryx63 // static void make_flat_edge(graph_t* g, spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt, int et) -public static void make_flat_edge(ST_Agraph_s g, ST_spline_info_t sp, ST_path P, __ptr__ edges, int ind, int cnt, int et) { +public static void make_flat_edge(ST_Agraph_s g, ST_spline_info_t sp, ST_path P, ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, int et) { ENTERING("6yr3jfkljl5w0z6dv354ryx63","make_flat_edge"); try { ST_Agnode_s tn, hn; @@ -2250,7 +2250,7 @@ try { final ST_pathend_t tend = new ST_pathend_t(), hend = new ST_pathend_t(); fwdedge.out.base.setPtr("data", fwdedgei); /* Get sample edge; normalize to go from left to right */ - e = (ST_Agedge_s) edges.plus(ind).getPtr(); + e = (ST_Agedge_s) edges.get(ind); isAdjacent = ED_adjacent(e); if ((ED_tree_index(e) & 32)!=0) { MAKEFWDEDGE(fwdedge.out, e); @@ -2277,8 +2277,8 @@ try { makeSimpleFlat (agtail(e), aghead(e), edges, ind, cnt, et); return; } - tside = ED_tail_port(e).getInt("side"); - hside = ED_head_port(e).getInt("side"); + tside = ED_tail_port(e).side; + hside = ED_head_port(e).side; if (((tside == (1<<0)) && (hside != (1<<2))) || ((hside == (1<<0)) && (tside != (1<<2)))) { make_flat_bottom_edges (g, sp, P, edges, ind, cnt, e, et == (5 << 1)); @@ -2293,13 +2293,13 @@ try { prevr = GD_rank(g).plus(r-2); else prevr = GD_rank(g).plus(r-1); - vspace = ND_coord(prevr.getPtr().v.plus(0).getPtr()).getDouble("y") - prevr.getPtr().getDouble("ht1") - - ND_coord(tn).getDouble("y") - GD_rank(g).plus(r).getDouble("ht2"); + vspace = ND_coord(prevr.getPtr().v.get(0)).y - prevr.getPtr().ht1 + - ND_coord(tn).y - GD_rank(g).get(r).ht2; } else { vspace = GD_ranksep(g); } - stepx = ((double)sp.getInt("Multisep")) / (cnt+1); + stepx = ((double)sp.Multisep) / (cnt+1); stepy = vspace / (cnt+1); makeFlatEnd (g, sp, P, tn, e, tend, true); makeFlatEnd (g, sp, P, hn, e, hend, false); @@ -2308,32 +2308,32 @@ try { final ST_boxf b = new ST_boxf(); e = (ST_Agedge_s) edges.plus(ind + i).getPtr(); boxn = 0; - b.___((tend).boxes[tend.getInt("boxn") - 1]); + b.___((tend).boxes[tend.boxn - 1]); ((Z.z().boxes[boxn])).LL.x = b.LL.x; ((Z.z().boxes[boxn])).LL.y = b.UR.y; ((Z.z().boxes[boxn])).UR.x = b.UR.x + (i + 1) * stepx; ((Z.z().boxes[boxn])).UR.y = b.UR.y + (i + 1) * stepy; boxn++; - ((Z.z().boxes[boxn])).LL.x = ((ST_boxf)((tend).boxes[tend.getInt("boxn") - 1])).LL.x; + ((Z.z().boxes[boxn])).LL.x = ((ST_boxf)((tend).boxes[tend.boxn - 1])).LL.x; ((Z.z().boxes[boxn])).LL.y = (Z.z().boxes[boxn-1]).UR.y; - ((Z.z().boxes[boxn])).UR.x = ((ST_boxf)((hend).boxes[hend.getInt("boxn") - 1])).UR.x; + ((Z.z().boxes[boxn])).UR.x = ((ST_boxf)((hend).boxes[hend.boxn - 1])).UR.x; ((Z.z().boxes[boxn])).UR.y = ((Z.z().boxes[boxn])).LL.y + stepy; boxn++; - b.___((hend).boxes[hend.getInt("boxn") - 1]); + b.___((hend).boxes[hend.boxn - 1]); ((Z.z().boxes[boxn])).UR.x = b.UR.x; ((Z.z().boxes[boxn])).LL.y = b.UR.y; ((Z.z().boxes[boxn])).LL.x = b.LL.x - (i + 1) * stepx; ((Z.z().boxes[boxn])).UR.y = (Z.z().boxes[boxn-1]).LL.y; boxn++; - for (j = 0; j < tend.getInt("boxn"); j++) add_box(P, (tend).boxes[j]); + for (j = 0; j < tend.boxn; j++) add_box(P, (tend).boxes[j]); for (j = 0; j < boxn; j++) add_box(P, Z.z().boxes[j]); - for (j = hend.getInt("boxn") - 1; j >= 0; j--) add_box(P, (hend).boxes[j]); + for (j = hend.boxn - 1; j >= 0; j--) add_box(P, (hend).boxes[j]); if (et == (5 << 1)) ps = routesplines(P, pn); else ps = routepolylines(P, pn); if (pn[0] == 0) return; clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo); - P.setInt("nbox", 0); + P.nbox = 0; } } finally { LEAVING("6yr3jfkljl5w0z6dv354ryx63","make_flat_edge"); @@ -2440,7 +2440,7 @@ LEAVING("2n9bpvx34fnukqu1f9u4v7v6n","makeLineEdge"); //private static int numpts2; //3 30wfq1dby4t07hft9io52nq6z // static void make_regular_edge(graph_t* g, spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt, int et) -public static void make_regular_edge(ST_Agraph_s g, ST_spline_info_t sp, ST_path P, __ptr__ edges, int ind, int cnt, int et) { +public static void make_regular_edge(ST_Agraph_s g, ST_spline_info_t sp, ST_path P, ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, int et) { ENTERING("30wfq1dby4t07hft9io52nq6z","make_regular_edge"); try { ST_Agnode_s tn, hn = null; @@ -2464,7 +2464,7 @@ try { Z.z().numpts2 = 2000; } sl = 0; - e = (ST_Agedge_s) edges.plus(ind).getPtr(); + e = (ST_Agedge_s) edges.get(ind); hackflag = 0; if (ABS(ND_rank(agtail(e)) - ND_rank(aghead(e))) > 1) { UNSUPPORTED("8f17srpa5iisomehrb4b01h51"); // fwdedgeai = *(Agedgeinfo_t*)e->base.data; @@ -2492,8 +2492,8 @@ UNSUPPORTED("eih8eaai768x1un5mixrtgstp"); // e = &fwdedgea.out; UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0); } else { if ((ED_tree_index(e) & 32)!=0) { - MAKEFWDEDGE(fwdedgea.getPtr("out"), e); - e = (ST_Agedge_s) fwdedgea.getPtr("out"); + MAKEFWDEDGE(fwdedgea.out, e); + e = fwdedgea.out; } } fe = e; @@ -2508,22 +2508,22 @@ UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0); tn = agtail(e); hn = aghead(e); b.___(maximal_bbox(g, sp, tn, null, e)); - tend.getStruct("nb").___(b); + tend.nb.___(b); beginpath(P, e, 1, tend, spline_merge(tn)); b.UR.y = - (tend).boxes[tend.getInt("boxn") - 1].UR.y; + (tend).boxes[tend.boxn - 1].UR.y; b.LL.y = - (tend).boxes[tend.getInt("boxn") - 1].LL.y; + (tend).boxes[tend.boxn - 1].LL.y; b.___(makeregularend(b, (1<<0), - ND_coord(tn).getDouble("y") - GD_rank(g).plus(ND_rank(tn)).getDouble("ht1"))); + ND_coord(tn).y - GD_rank(g).get(ND_rank(tn)).ht1)); if (b.LL.x < b.UR.x && b.LL.y < b.UR.y) { - tend.boxes[tend.getInt("boxn")].___(b); - tend.setInt("boxn", tend.getInt("boxn") + 1); + tend.boxes[tend.boxn].___(b); + tend.setInt("boxn", tend.boxn + 1); } longedge = 0; smode = false; si = -1; - while (ND_node_type(hn) == 1 && N(((Boolean)Z.z().sinfo.call("splineMerge", hn)).booleanValue())) { + while (ND_node_type(hn) == 1 && N(((Boolean)Z.z().sinfo.splineMerge.exe(hn)).booleanValue())) { longedge = 1; Z.z().boxes[boxn++].___(rank_box(sp, g, ND_rank(tn))); if (N(smode) @@ -2542,12 +2542,12 @@ UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0); } hend.setStruct("nb", maximal_bbox(g, sp, hn, e, (ST_Agedge_s) ND_out(hn).getFromList(0))); endpath(P, e, 1, hend, spline_merge(aghead(e))); - b.___(makeregularend((hend).boxes[hend.getInt("boxn") - 1], (1<<2), - ND_coord(hn).getDouble("y") + GD_rank(g).plus(ND_rank(hn)).getDouble("ht2"))); + b.___(makeregularend((hend).boxes[hend.boxn - 1], (1<<2), + ND_coord(hn).y + GD_rank(g).get(ND_rank(hn)).ht2)); if (b.LL.x < b.UR.x && b.LL.y < b.UR.y) UNSUPPORTED("1crhubfzekx1qi2ti9ajqsfoc"); // hend.boxes[hend.boxn++] = b; - P.getStruct("end").setDouble("theta", M_PI / 2); - P.getStruct("end").constrained= NOTI(false); + P.end.setDouble("theta", M_PI / 2); + P.end.constrained= NOTI(false); completeregularpath(P, segfirst, e, tend, hend, Z.z().boxes, boxn, 1); if (splines) ps = routesplines(P, pn); else { @@ -2578,8 +2578,8 @@ UNSUPPORTED("8kbxhk7qirj3tr7hn1ukwar3h"); // pointfs = RALLOC(numpts, pointfs, boxn = 0; tend.setStruct("nb", maximal_bbox(g, sp, tn, (ST_Agedge_s) ND_in(tn).getFromList(0), e)); beginpath(P, e, 1, tend, spline_merge(tn)); - b.___(makeregularend((tend).boxes[tend.getInt("boxn") - 1], (1<<0), - ND_coord(tn).getDouble("y") - GD_rank(g).plus(ND_rank(tn)).getDouble("ht1"))); + b.___(makeregularend((tend).boxes[tend.boxn - 1], (1<<0), + ND_coord(tn).y - GD_rank(g).get(ND_rank(tn)).ht1)); if (b.LL.x < b.UR.x && b.LL.y < b.UR.y) UNSUPPORTED("cjx6tldge3otk1pk6ks1pkn2w"); // tend.boxes[tend.boxn++] = b; P.start.setDouble("theta", -M_PI / 2); @@ -2588,16 +2588,16 @@ UNSUPPORTED("cjx6tldge3otk1pk6ks1pkn2w"); // tend.boxes[tend.boxn++] = } Z.z().boxes[boxn++].___(rank_box(sp, g, ND_rank(tn))); b.___(maximal_bbox(g, sp, hn, e, null)); - hend.getStruct("nb").___(b); + hend.nb.___(b); endpath(P, (ST_Agedge_s) (hackflag!=0 ? fwdedgeb.out : e), 1, hend, spline_merge(aghead(e))); - b.UR.y = (hend).boxes[hend.getInt("boxn") - 1].UR.y; - b.LL.y = (hend).boxes[hend.getInt("boxn") - 1].LL.y; + b.UR.y = (hend).boxes[hend.boxn - 1].UR.y; + b.LL.y = (hend).boxes[hend.boxn - 1].LL.y; b.___(makeregularend(b, (1<<2), - ND_coord(hn).getDouble("y") + GD_rank(g).plus(ND_rank(hn)).getDouble("ht2"))); + ND_coord(hn).y + GD_rank(g).get(ND_rank(hn)).ht2)); if (b.LL.x < b.UR.x && b.LL.y < b.UR.y) { - hend.boxes[hend.getInt("boxn")].___(b); - hend.setInt("boxn", hend.getInt("boxn")+1); + hend.boxes[hend.boxn].___(b); + hend.setInt("boxn", hend.boxn+1); } completeregularpath(P, segfirst, e, tend, hend, Z.z().boxes, boxn, longedge); @@ -2630,9 +2630,9 @@ UNSUPPORTED("bedaqcn9h03q6ia6zbezuee1m"); // pointfs = RALLOC(numpts, point clip_and_install(fe, hn, Z.z().pointfs, pointn[0], Z.z().sinfo); return; } - dx = sp.getInt("Multisep") * (cnt - 1) / 2; + dx = sp.Multisep * (cnt - 1) / 2; for (i = 1; i < pointn[0] - 1; i++) - Z.z().pointfs.plus(i).setDouble("x", Z.z().pointfs.plus(i).getDouble("x") - dx); + Z.z().pointfs.plus(i).setDouble("x", Z.z().pointfs.get(i).x - dx); if (Z.z().numpts > Z.z().numpts2) { UNSUPPORTED("9ubr4m7bdv5f5ldk2ta6yw3up"); // numpts2 = numpts; UNSUPPORTED("8qwp7ddy5ztgam63fzfjmu890"); // pointfs2 = RALLOC(numpts2, pointfs2, pointf); @@ -2647,7 +2647,7 @@ UNSUPPORTED("8qwp7ddy5ztgam63fzfjmu890"); // pointfs2 = RALLOC(numpts2, pointfs e = (ST_Agedge_s) fwdedge.out; } for (i = 1; i < pointn[0] - 1; i++) - Z.z().pointfs.plus(i).setDouble("x", Z.z().pointfs.plus(i).getDouble("x") + sp.getInt("Multisep")); + Z.z().pointfs.plus(i).setDouble("x", Z.z().pointfs.get(i).x + sp.Multisep); for (i = 0; i < pointn[0]; i++) Z.z().pointfs2.plus(i).setStruct(Z.z().pointfs.plus(i).getStruct()); clip_and_install(e, aghead(e), Z.z().pointfs2, pointn[0], Z.z().sinfo); @@ -2676,34 +2676,34 @@ try { uright = top_bound(first, 1); if (uleft!=null) { if (N(spl = getsplinepoints(uleft))) return; - pp = ((ST_bezier)spl.list.plus(0).getPtr().getPtr()).list; - pn = spl.list.plus(0).getPtr().getInt("size"); + pp = ((ST_bezier)spl.list.get(0).getPtr()).list; + pn = spl.list.get(0).size; } if (uright!=null) { if (N(spl = getsplinepoints(uright))) return; - pp = ((ST_bezier)spl.list.plus(0).getPtr().getPtr()).list; - pn = spl.list.plus(0).getPtr().getInt("size"); + pp = ((ST_bezier)spl.list.get(0).getPtr()).list; + pn = spl.list.get(0).size; } lleft = lright = null; lleft = bot_bound(last, -1); lright = bot_bound(last, 1); if (lleft!=null) { if (N(spl = getsplinepoints(lleft))) return; - pp = ((ST_bezier)spl.list.plus(spl.getInt("size") - 1).getPtr().getPtr()).list; - pn = spl.list.plus(spl.getInt("size") - 1).getPtr().getInt("size"); + pp = ((ST_bezier)spl.list.plus(spl.size - 1).getPtr().getPtr()).list; + pn = spl.list.plus(spl.size - 1).getPtr().size; } if (lright!=null) { if (N(spl = getsplinepoints(lright))) return; - pp = ((ST_bezier)spl.list.plus(spl.getInt("size") - 1).getPtr().getPtr()).list; - pn = spl.list.plus(spl.getInt("size") - 1).getPtr().getInt("size"); + pp = ((ST_bezier)spl.list.plus(spl.size - 1).getPtr().getPtr()).list; + pn = spl.list.plus(spl.size - 1).getPtr().size; } - for (i = 0; i < tendp.getInt("boxn"); i++) + for (i = 0; i < tendp.boxn; i++) add_box(P, (tendp).boxes[i]); - fb = P.getInt("nbox") + 1; + fb = P.nbox + 1; lb = fb + boxn - 3; for (i = 0; i < boxn; i++) add_box(P, boxes[i]); - for (i = hendp.getInt("boxn") - 1; i >= 0; i--) + for (i = hendp.boxn - 1; i >= 0; i--) add_box(P, (hendp).boxes[i]); adjustregularpath(P, fb, lb); } finally { @@ -2764,7 +2764,7 @@ try { } } } - for (i = 0; i < P.getInt("nbox") - 1; i++) { + for (i = 0; i < P.nbox - 1; i++) { bp1 = (ST_boxf) P.boxes[i]; bp2 = (ST_boxf) P.boxes[i+1]; if (i >= fb && i <= lb && (i - fb) % 2 == 0) { @@ -2800,14 +2800,14 @@ try { ST_Agnode_s /* *right0, *right1, */ left0, left1; b.___(sp.Rank_box[r]); if (b.LL.x == b.UR.x) { - left0 = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(0).getPtr(); + left0 = (ST_Agnode_s) GD_rank(g).get(r).v.get(0); /* right0 = GD_rank(g)[r].v[GD_rank(g)[r].n - 1]; */ - left1 = (ST_Agnode_s) GD_rank(g).plus(r + 1).getPtr().v.plus(0).getPtr(); + left1 = (ST_Agnode_s) GD_rank(g).get(r + 1).v.get(0); /* right1 = GD_rank(g)[r + 1].v[GD_rank(g)[r + 1].n - 1]; */ - b.LL.x = sp.getInt("LeftBound"); - b.LL.y = ND_coord(left1).getDouble("y") + GD_rank(g).plus(r + 1).getDouble("ht2"); - b.UR.x = sp.getInt("RightBound"); - b.UR.y = ND_coord(left0).getDouble("y") - GD_rank(g).plus(r).getDouble("ht1"); + b.LL.x = sp.LeftBound; + b.LL.y = ND_coord(left1).y + GD_rank(g).get(r + 1).ht2; + b.UR.x = sp.RightBound; + b.UR.y = ND_coord(left0).y - GD_rank(g).get(r).ht1; sp.Rank_box[r].setStruct(b); } return b; @@ -2833,7 +2833,7 @@ try { break; if ((ND_out(v).size != 1) || (ND_in(v).size != 1)) break; - if (ND_coord(v).getDouble("x") != ND_coord(n).getDouble("x")) + if (ND_coord(v).x != ND_coord(n).x) break; cnt++; } @@ -2876,13 +2876,13 @@ try { ST_Agnode_s vn; b = 0; /* skip first rank box */ for (vn = aghead(e); - ND_node_type(vn) == 1 && N(((Boolean)Z.z().sinfo.call("splineMerge", vn)).booleanValue()); + ND_node_type(vn) == 1 && N(((Boolean)Z.z().sinfo.splineMerge.exe(vn)).booleanValue()); vn = aghead(ND_out(vn).getFromList(0))) { - while ((b < p.getInt("nbox")) && (p.boxes[b].LL.y > ND_coord(vn).getDouble("y"))) + while ((b < p.nbox) && (p.boxes[b].LL.y > ND_coord(vn).y)) b++; - if (b >= p.getInt("nbox")) + if (b >= p.nbox) break; - if (p.boxes[b].UR.y < ND_coord(vn).getDouble("y")) + if (p.boxes[b].UR.y < ND_coord(vn).y) continue; if (ND_label(vn)!=null) resize_vn(vn, (int)p.boxes[b].LL.x, (int)p.boxes[b].UR.x, @@ -2973,8 +2973,8 @@ LEAVING("9fsg0uiyhtrayd4mimmc0i25e","bot_bound"); public static boolean cl_vninside(ST_Agraph_s cl, ST_Agnode_s n) { ENTERING("65uvkv1mextaah5m997ibe3qs","cl_vninside"); try { - return (BETWEEN(GD_bb(cl).LL.x, (double)(ND_coord(n).getDouble("x")), GD_bb(cl).UR.x) && - BETWEEN(GD_bb(cl).LL.y, (double)(ND_coord(n).getDouble("y")), GD_bb(cl).UR.y)); + return (BETWEEN(GD_bb(cl).LL.x, (double)(ND_coord(n).x), GD_bb(cl).UR.x) && + BETWEEN(GD_bb(cl).LL.y, (double)(ND_coord(n).y), GD_bb(cl).UR.y)); } finally { LEAVING("65uvkv1mextaah5m997ibe3qs","cl_vninside"); } @@ -3037,48 +3037,48 @@ try { final ST_boxf rv = new ST_boxf(); left_cl = right_cl = null; /* give this node all the available space up to its neighbors */ - b = (double)(ND_coord(vn).getDouble("x") - ND_lw(vn) - 4); + b = (double)(ND_coord(vn).x - ND_lw(vn) - 4); if ((left = neighbor(g, vn, ie, oe, -1))!=null) { if ((left_cl = cl_bound(g, vn, left))!=null) - nb = GD_bb(left_cl).UR.x + (double)(sp.getInt("Splinesep")); + nb = GD_bb(left_cl).UR.x + (double)(sp.Splinesep); else { - nb = (double)(ND_coord(left).getDouble("x") + ND_mval(left)); + nb = (double)(ND_coord(left).x + ND_mval(left)); if (ND_node_type(left) == 0) nb += GD_nodesep(g) / 2.; else - nb += (double)(sp.getInt("Splinesep")); + nb += (double)(sp.Splinesep); } if (nb < b) b = nb; rv.LL.x = ROUND(b); } else - rv.LL.x = MIN(ROUND(b), sp.getInt("LeftBound")); + rv.LL.x = MIN(ROUND(b), sp.LeftBound); /* we have to leave room for our own label! */ if ((ND_node_type(vn) == 1) && (ND_label(vn)!=null)) - b = (double)(ND_coord(vn).getDouble("x") + 10); + b = (double)(ND_coord(vn).x + 10); else - b = (double)(ND_coord(vn).getDouble("x") + ND_rw(vn) + 4); + b = (double)(ND_coord(vn).x + ND_rw(vn) + 4); if ((right = neighbor(g, vn, ie, oe, 1))!=null) { if ((right_cl = cl_bound(g, vn, right))!=null) - nb = GD_bb(right_cl).LL.x - (double)(sp.getInt("Splinesep")); + nb = GD_bb(right_cl).LL.x - (double)(sp.Splinesep); else { - nb = ND_coord(right).getDouble("x") - ND_lw(right); + nb = ND_coord(right).x - ND_lw(right); if (ND_node_type(right) == 0) nb -= GD_nodesep(g) / 2.; else - nb -= (double)(sp.getInt("Splinesep")); + nb -= (double)(sp.Splinesep); } if (nb > b) b = nb; rv.UR.x = ROUND(b); } else - rv.UR.x = MAX(ROUND(b), sp.getInt("RightBound")); + rv.UR.x = MAX(ROUND(b), sp.RightBound); if ((ND_node_type(vn) == 1) && (ND_label(vn)!=null)) { rv.UR.x = rv.UR.x - ND_rw(vn); - if (rv.UR.x < rv.LL.x) rv.UR.x = ND_coord(vn).getDouble("x"); + if (rv.UR.x < rv.LL.x) rv.UR.x = ND_coord(vn).x; } - rv.LL.y = ND_coord(vn).getDouble("y") - GD_rank(g).plus(ND_rank(vn)).getDouble("ht1"); - rv.UR.y = ND_coord(vn).getDouble("y") + GD_rank(g).plus(ND_rank(vn)).getDouble("ht2"); + rv.LL.y = ND_coord(vn).y - GD_rank(g).get(ND_rank(vn)).ht1; + rv.UR.y = ND_coord(vn).y + GD_rank(g).get(ND_rank(vn)).ht2; return rv; } finally { LEAVING("6qwgl36ugfnduc5x59ohuewv1","maximal_bbox"); @@ -3096,8 +3096,8 @@ try { int i; ST_Agnode_s n, rv = null; ST_rank_t.Array2 rank = GD_rank(g).plus(ND_rank(vn)); - for (i = ND_order(vn) + dir; ((i >= 0) && (i < rank.getInt("n"))); i += dir) { - n = (ST_Agnode_s) rank.getPtr().v.plus(i).getPtr(); + for (i = ND_order(vn) + dir; ((i >= 0) && (i < rank.getPtr().n)); i += dir) { + n = (ST_Agnode_s) rank.getPtr().v.get(i); if ((ND_node_type(n) == 1) && (ND_label(n)!=null)) { rv = n; break; diff --git a/src/gen/lib/dotgen/fastgr__c.java b/src/gen/lib/dotgen/fastgr__c.java index 9a8a1023d..01e27f31a 100644 --- a/src/gen/lib/dotgen/fastgr__c.java +++ b/src/gen/lib/dotgen/fastgr__c.java @@ -47,10 +47,8 @@ package gen.lib.dotgen; import static gen.lib.cgraph.edge__c.aghead; import static gen.lib.cgraph.edge__c.agtail; import static gen.lib.cgraph.obj__c.agroot; -import static gen.lib.common.memory__c.zmalloc; import static gen.lib.dotgen.dotinit__c.dot_root; import static smetana.core.JUtils.EQ; -import static smetana.core.JUtils.sizeof; import static smetana.core.JUtilsDebug.ENTERING; import static smetana.core.JUtilsDebug.LEAVING; import static smetana.core.Macro.AGINEDGE; @@ -89,16 +87,14 @@ import static smetana.core.Macro.agtail; import static smetana.core.Macro.alloc_elist; import static smetana.core.Macro.elist_append; import h.ST_Agedge_s; -import h.ST_Agnode_s; -import h.ST_Agraph_s; import h.ST_Agedgeinfo_t; import h.ST_Agedgepair_s; import h.ST_Agnode_s; import h.ST_Agnodeinfo_t; +import h.ST_Agraph_s; import h.ST_Agrec_s; import h.ST_elist; import h.ST_pointf; -import h.ST_elist; public class fastgr__c { //1 2digov3edok6d5srhgtlmrycs @@ -425,8 +421,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/dotgen/flat__c.java b/src/gen/lib/dotgen/flat__c.java index 1159c99e8..fd776b5a8 100644 --- a/src/gen/lib/dotgen/flat__c.java +++ b/src/gen/lib/dotgen/flat__c.java @@ -419,8 +419,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -723,19 +723,19 @@ try { int i; ST_Agnode_s.ArrayOfStar v; ST_Agnode_s n; - v = ALLOC_Agnode_s(GD_rank(g).plus(r).getInt("n") + 2, (ST_Agnode_s.ArrayOfStar) GD_rank(g).plus(r).getPtr("v")); + v = ALLOC_Agnode_s(GD_rank(g).get(r).n + 2, (ST_Agnode_s.ArrayOfStar) GD_rank(g).get(r).v); GD_rank(g).plus(r).setPtr("v", v); - for (i = GD_rank(g).plus(r).getInt("n"); i > pos; i--) { + for (i = GD_rank(g).get(r).n; i > pos; i--) { v.plus(i).setPtr(v.plus(i - 1).getPtr()); - ND_order(v.plus(i).getPtr(), ND_order(v.plus(i).getPtr())+1); + ND_order(v.get(i), ND_order(v.get(i))+1); } n = virtual_node(g); v.plus(pos).setPtr(n); ND_order(n, pos); ND_rank(n, r); - GD_rank(g).plus(r).setInt("n", GD_rank(g).plus(r).getInt("n")+1); - v.plus(GD_rank(g).plus(r).getInt("n")).setPtr(null); - return (ST_Agnode_s) v.plus(pos).getPtr(); + GD_rank(g).plus(r).setInt("n", GD_rank(g).get(r).n+1); + v.plus(GD_rank(g).get(r).n).setPtr(null); + return (ST_Agnode_s) v.get(pos); } finally { LEAVING("e0gtvsxlvztmwu8yy44wfvf97","make_vn_slot"); } @@ -830,18 +830,18 @@ try { int lnode, rnode, r, pos; int[] lpos = new int[1], rpos = new int[1]; int bounds[] = new int[4]; - __ptr__ rank; + ST_Agnode_s.ArrayOfStar rank; r = ND_rank(agtail(e)) - 1; - rank = GD_rank(g).plus(r).getPtr("v"); + rank = GD_rank(g).get(r).v; lnode = 0; - rnode = GD_rank(g).plus(r).getInt("n") - 1; + rnode = GD_rank(g).get(r).n - 1; bounds[0] = bounds[2] = lnode - 1; bounds[1] = bounds[3] = rnode + 1; findlr(agtail(e), aghead(e), lpos, rpos); while (lnode <= rnode) { - setbounds((ST_Agnode_s)rank.plus(lnode).getPtr(), bounds, lpos, rpos); + setbounds((ST_Agnode_s)rank.get(lnode), bounds, lpos, rpos); if (lnode != rnode) - setbounds((ST_Agnode_s)rank.plus(rnode).getPtr(), bounds, lpos, rpos); + setbounds((ST_Agnode_s)rank.get(rnode), bounds, lpos, rpos); lnode++; rnode--; if (bounds[1] - bounds[0] <= 1) @@ -876,37 +876,37 @@ try { r = ND_rank(agtail(e)); place = flat_limits(g, e); /* grab ypos = LL.y of label box before make_vn_slot() */ - if ((n = (ST_Agnode_s) GD_rank(g).plus(r - 1).getPtr().v.plus(0).getPtr())!=null) - ypos = (int)(ND_coord(n).getDouble("y") - GD_rank(g).plus(r - 1).getDouble("ht1")); + if ((n = (ST_Agnode_s) GD_rank(g).get(r - 1).v.get(0))!=null) + ypos = (int)(ND_coord(n).y - GD_rank(g).get(r - 1).ht1); else { - n = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(0).getPtr(); - ypos = (int)(ND_coord(n).getDouble("y") + GD_rank(g).plus(r).getDouble("ht2") + GD_ranksep(g)); + n = (ST_Agnode_s) GD_rank(g).get(r).v.get(0); + ypos = (int)(ND_coord(n).y + GD_rank(g).get(r).ht2 + GD_ranksep(g)); } vn = make_vn_slot(g, r - 1, place); dimen.___(ED_label(e).dimen); if (GD_flip(g)!=0) { - double f = dimen.getDouble("x"); - dimen.setDouble("x", dimen.getDouble("y")); + double f = dimen.x; + dimen.setDouble("x", dimen.y); dimen.setDouble("y", f); } - ND_ht(vn, dimen.getDouble("y")); + ND_ht(vn, dimen.y); h2 = (int)(ND_ht(vn) / 2); - ND_rw(vn, dimen.getDouble("x") / 2); + ND_rw(vn, dimen.x / 2); ND_lw(vn, ND_rw(vn)); ND_label(vn, ED_label(e)); ND_coord(vn).setDouble("y", ypos + h2); ve = virtual_edge(vn, agtail(e), e); /* was NULL? */ - ED_tail_port(ve).getStruct("p").setDouble("x", -ND_lw(vn)); - ED_head_port(ve).getStruct("p").setDouble("x", ND_rw(agtail(e))); + ED_tail_port(ve).p.setDouble("x", -ND_lw(vn)); + ED_head_port(ve).p.setDouble("x", ND_rw(agtail(e))); ED_edge_type(ve, 4); ve = virtual_edge(vn, aghead(e), e); - ED_tail_port(ve).getStruct("p").setDouble("x", ND_rw(vn)); - ED_head_port(ve).getStruct("p").setDouble("x", ND_lw(aghead(e))); + ED_tail_port(ve).p.setDouble("x", ND_rw(vn)); + ED_head_port(ve).p.setDouble("x", ND_lw(aghead(e))); ED_edge_type(ve, 4); /* another assumed symmetry of ht1/ht2 of a label node */ - if (GD_rank(g).plus(r - 1).getDouble("ht1") < h2) + if (GD_rank(g).get(r - 1).ht1 < h2) GD_rank(g).plus(r - 1).setDouble("ht1", h2); - if (GD_rank(g).plus(r - 1).getDouble("ht2") < h2) + if (GD_rank(g).get(r - 1).ht2 < h2) GD_rank(g).plus(r - 1).setDouble("ht2", h2); ND_alg(vn, e); } finally { @@ -930,11 +930,11 @@ try { rptr = ALLOC_ST_rank_t(r, (ST_rank_t.Array2) GD_rank(g)); GD_rank(g, rptr.plus(1)); for (r = GD_maxrank(g); r >= 0; r--) - GD_rank(g).plus(r).getPtr().setStruct(GD_rank(g).plus(r - 1).getPtr().getStruct()); + GD_rank(g).get(r).setStruct(GD_rank(g).get(r - 1).getStruct()); GD_rank(g).plus(r).setInt("n", 0); GD_rank(g).plus(r).setInt("an", 0); GD_rank(g).plus(r).setPtr("v", new ST_Agnode_s.ArrayOfStar(2)); - GD_rank(g).plus(r).setPtr("av", GD_rank(g).plus(r).getPtr("v")); + GD_rank(g).plus(r).setPtr("av", GD_rank(g).get(r).v); GD_rank(g).plus(r).setPtr("flat", null); GD_rank(g).plus(r).setDouble("ht1", 1); GD_rank(g).plus(r).setDouble("ht2", 1); @@ -969,7 +969,7 @@ try { } rank = GD_rank(dot_root(tn)).plus(ND_rank(tn)); for (i = lo + 1; i < hi; i++) { - n = (ST_Agnode_s) rank.getPtr().v.plus(i).getPtr(); + n = (ST_Agnode_s) rank.getPtr().v.get(i); if ((ND_node_type(n) == 1 && ND_label(n)!=null) || ND_node_type(n) == 0) break; @@ -1009,8 +1009,8 @@ try { checkFlatAdjacent (e); } } - if ((GD_rank(g).plus(0).getPtr("flat")!=null) || (GD_n_cluster(g) > 0)) { - for (i = 0; (n = (ST_Agnode_s) GD_rank(g).plus(0).getPtr().v.plus(i).getPtr())!=null; i++) { + if ((GD_rank(g).get(0).flat!=null) || (GD_n_cluster(g) > 0)) { + for (i = 0; (n = (ST_Agnode_s) GD_rank(g).get(0).v.get(i))!=null; i++) { for (j = 0; (e = (ST_Agedge_s) ND_flat_in(n).getFromList(j))!=null; j++) { if ((ED_label(e)!=null) && N(ED_adjacent(e))) { abomination(g); @@ -1029,8 +1029,8 @@ try { for (i = 0; (e = (ST_Agedge_s) ND_flat_out(n).getFromList(i))!=null; i++) { if (ED_label(e)!=null) { if (ED_adjacent(e)!=0) { - if (GD_flip(g)!=0) ED_dist(e, ED_label(e).dimen.getDouble("y")); - else ED_dist(e, ED_label(e).dimen.getDouble("x")); + if (GD_flip(g)!=0) ED_dist(e, ED_label(e).dimen.y); + else ED_dist(e, ED_label(e).dimen.x); } else { reset = 1; @@ -1050,8 +1050,8 @@ try { if (ED_label(e)!=null) { if (ED_adjacent(e)!=0) { double lw; - if (GD_flip(g)!=0) lw = ED_label(e).dimen.getDouble("y"); - else lw = ED_label(e).dimen.getDouble("x"); + if (GD_flip(g)!=0) lw = ED_label(e).dimen.y; + else lw = ED_label(e).dimen.x; ED_dist(le, MAX(lw,ED_dist(le))); } else { diff --git a/src/gen/lib/dotgen/mincross__c.java b/src/gen/lib/dotgen/mincross__c.java index f00d24e6e..5d3527e7e 100644 --- a/src/gen/lib/dotgen/mincross__c.java +++ b/src/gen/lib/dotgen/mincross__c.java @@ -132,7 +132,6 @@ import h.ST_elist; import h.ST_nodequeue; import h.ST_pointf; import h.ST_rank_t; -import h.rank_t; import java.util.List; @@ -465,8 +464,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -848,7 +847,7 @@ try { merge2(g); /* run mincross on contents of each cluster */ for (c = 1; c <= GD_n_cluster(g); c++) { - nc += mincross_clust(g, (ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(), doBalance); + nc += mincross_clust(g, (ST_Agraph_s) GD_clust(g).get(c).getPtr(), doBalance); } if ((GD_n_cluster(g) > 0) && (N(s = agget(g, new CString("remincross"))) || (mapbool(s)))) { @@ -910,7 +909,7 @@ try { GD_nlist(g, GD_comp(g).getFromList(c)); if (c > 0) { for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { - GD_rank(g).plus(r).setPtr("v", GD_rank(g).plus(r).getPtr("v").plus(GD_rank(g).plus(r).getInt("n"))); + GD_rank(g).plus(r).setPtr("v", GD_rank(g).get(r).v.plus(GD_rank(g).get(r).n)); GD_rank(g).plus(r).setInt("n", 0); } } @@ -1080,7 +1079,7 @@ try { flat_reorder(g); nc = mincross_(g, 2, 2, doBalance); for (c = 1; c <= GD_n_cluster(g); c++) - nc += mincross_clust(g, (ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(), doBalance); + nc += mincross_clust(g, (ST_Agraph_s) GD_clust(g).get(c).getPtr(), doBalance); save_vlist(g); return nc; } finally { @@ -1112,10 +1111,10 @@ try { /*return ((ND_ranktype(v) != CLUSTER) && (ND_ranktype(w) != CLUSTER)); */ } } else { -UNSUPPORTED("8lltx4lxwrqossx8qw1khzwf9"); // if ((ND_clust(v)) != (ND_clust(w))) -UNSUPPORTED("9qhn9m3123s8n6wwxjfo8awlm"); // return NOT(0); + if (NEQ(ND_clust(v), ND_clust(w))) + return NOT(0); } - M = (ST_adjmatrix_t) GD_rank(g).plus(ND_rank(v)).getPtr().getPtr("flat"); + M = (ST_adjmatrix_t) GD_rank(g).plus(ND_rank(v)).getPtr().flat; if (M == null) rv = false; else { @@ -1201,9 +1200,9 @@ try { vi = ND_order(v); wi = ND_order(w); ND_order(v, wi); - GD_rank(Z.z().Root).plus(r).getPtr().v.plus(wi).setPtr(v); + GD_rank(Z.z().Root).get(r).v.plus(wi).setPtr(v); ND_order(w, vi); - GD_rank(Z.z().Root).plus(r).getPtr().v.plus(vi).setPtr(w); + GD_rank(Z.z().Root).get(r).v.plus(vi).setPtr(w); } finally { LEAVING("ba4tbr57wips1dzpgxzx3b6ja","exchange"); } @@ -1345,10 +1344,10 @@ try { int i, c0, c1, rv; ST_Agnode_s v, w; rv = 0; - GD_rank(g).plus(r).getPtr().candidate= false; - for (i = 0; i < GD_rank(g).plus(r).getInt("n") - 1; i++) { - v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); - w = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i + 1).getPtr(); + GD_rank(g).get(r).candidate= false; + for (i = 0; i < GD_rank(g).get(r).n - 1; i++) { + v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i); + w = (ST_Agnode_s) GD_rank(g).get(r).v.plus(i + 1).getPtr(); //assert(ND_order(v) < ND_order(w)); if (left2right(g, v, w)) continue; @@ -1357,22 +1356,22 @@ try { c0 += in_cross(v, w); c1 += in_cross(w, v); } - if (GD_rank(g).plus(r + 1).getInt("n") > 0) { + if (GD_rank(g).get(r + 1).n > 0) { c0 += out_cross(v, w); c1 += out_cross(w, v); } if ((c1 < c0) || ((c0 > 0) && reverse && (c1 == c0))) { exchange(v, w); rv += (c0 - c1); - GD_rank(Z.z().Root).plus(r).getPtr().valid= 0; - GD_rank(g).plus(r).getPtr().candidate= NOT(false); + GD_rank(Z.z().Root).get(r).valid= 0; + GD_rank(g).get(r).candidate= NOT(false); if (r > GD_minrank(g)) { GD_rank(Z.z().Root).plus(r - 1).getPtr().valid= 0; - GD_rank(g).plus(r - 1).getPtr().candidate= NOT(false); + GD_rank(g).get(r - 1).candidate= NOT(false); } if (r < GD_maxrank(g)) { GD_rank(Z.z().Root).plus(r + 1).getPtr().valid= 0; - GD_rank(g).plus(r + 1).getPtr().candidate= NOT(false); + GD_rank(g).get(r + 1).candidate= NOT(false); } } } @@ -1392,11 +1391,11 @@ ENTERING("2i22bxgg5y7v5c5d40k5zppky","transpose"); try { int r, delta; for (r = GD_minrank(g); r <= GD_maxrank(g); r++) - GD_rank(g).plus(r).getPtr().candidate= NOT(false); + GD_rank(g).get(r).candidate= NOT(false); do { delta = 0; for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { - if (GD_rank(g).plus(r).getPtr().candidate) { + if (GD_rank(g).get(r).candidate) { delta += transpose_step(g, r, reverse); } } @@ -1489,11 +1488,11 @@ try { ST_Agnode_s n; int r; for (n = GD_nlist(g); n!=null; n = ND_next(n)) - ND_order(n, (int)ND_coord(n).getDouble("x")); + ND_order(n, (int)ND_coord(n).x); for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { - GD_rank(Z.z().Root).plus(r).getPtr().valid= 0; - qsort(GD_rank(g).plus(r).getPtr("v"), - GD_rank(g).plus(r).getInt("n"), + GD_rank(Z.z().Root).get(r).valid= 0; + qsort(GD_rank(g).get(r).v, + GD_rank(g).get(r).n, function(mincross__c.class, "nodeposcmpf")); } } finally { @@ -1563,10 +1562,10 @@ try { merge_components(g); /* install complete ranks */ for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { - GD_rank(g).plus(r).setInt("n", GD_rank(g).plus(r).getInt("an")); - GD_rank(g).plus(r).setPtr("v", GD_rank(g).plus(r).getPtr("av")); - for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { - v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); + GD_rank(g).plus(r).setInt("n", GD_rank(g).get(r).an); + GD_rank(g).plus(r).setPtr("v", GD_rank(g).get(r).av); + for (i = 0; i < GD_rank(g).get(r).n; i++) { + v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i); if (v == null) { /*if (Verbose) fprintf(stderr, @@ -1604,23 +1603,23 @@ try { } /* fix vlists of clusters */ for (c = 1; c <= GD_n_cluster(g); c++) - rec_reset_vlists((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); + rec_reset_vlists((ST_Agraph_s) GD_clust(g).get(c).getPtr()); /* remove node temporary edges for ordering nodes */ for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { - for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { - v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); + for (i = 0; i < GD_rank(g).get(r).n; i++) { + v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i); ND_order(v, i); if (ND_flat_out(v).listNotNull()) { for (j = 0; (e = (ST_Agedge_s) ND_flat_out(v).getFromList(j))!=null; j++) if (ED_edge_type(e) == 4) { delete_flat_edge(e); - Memory.free(e.getPtr("base.data")); + Memory.free(e.base.data); Memory.free(e); j--; } } } - free_matrix((ST_adjmatrix_t) GD_rank(g).plus(r).getPtr("flat")); + free_matrix((ST_adjmatrix_t) GD_rank(g).get(r).flat); } /*if (Verbose) fprintf(stderr, "mincross %s: %d crossings, %.2f secs.\n", @@ -1736,7 +1735,7 @@ try { int r; if (GD_rankleader(g)!=null) for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { - GD_rankleader(g).plus(r).setPtr(GD_rank(g).plus(r).getPtr().v.plus(0).getPtr()); + GD_rankleader(g).plus(r).setPtr(GD_rank(g).get(r).v.get(0)); } } finally { LEAVING("bwmu2hkwud40601oq5vgo2f1h","save_vlist"); @@ -1754,7 +1753,7 @@ try { int c; save_vlist(g); for (c = 1; c <= GD_n_cluster(g); c++) - rec_save_vlists((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); + rec_save_vlists((ST_Agraph_s) GD_clust(g).get(c).getPtr()); } finally { LEAVING("hwdxg97sefkuyd25x2q4pgzg","rec_save_vlists"); } @@ -1772,14 +1771,14 @@ try { ST_Agnode_s u, v, w; /* fix vlists of sub-clusters */ for (c = 1; c <= GD_n_cluster(g); c++) - rec_reset_vlists((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); + rec_reset_vlists((ST_Agraph_s) GD_clust(g).get(c).getPtr()); if (GD_rankleader(g)!=null) for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { - v = (ST_Agnode_s) GD_rankleader(g).plus(r).getPtr(); + v = (ST_Agnode_s) GD_rankleader(g).get(r); u = furthestnode(g, v, -1); w = furthestnode(g, v, 1); GD_rankleader(g).plus(r).setPtr(u); - GD_rank(g).plus(r).setPtr("v", GD_rank(dot_root(g)).plus(r).getPtr("v").plus(ND_order(u))); + GD_rank(g).plus(r).setPtr("v", GD_rank(dot_root(g)).get(r).v.plus(ND_order(u))); GD_rank(g).plus(r).setInt("n", ND_order(w) - ND_order(u) + 1); } } finally { @@ -1939,7 +1938,7 @@ try { int i; boolean hascl; ST_Agedge_s e; - ST_adjmatrix_t M = (ST_adjmatrix_t) GD_rank(g).plus(ND_rank(v)).getPtr("flat"); + ST_adjmatrix_t M = (ST_adjmatrix_t) GD_rank(g).get(ND_rank(v)).flat; ND_mark(v, NOT(false)); ND_onstack(v, NOT(false)); hascl = (GD_n_cluster(dot_root(g)) > 0); @@ -1951,8 +1950,8 @@ try { if (ED_weight(e) == 0) continue; if (ND_onstack(aghead(e)) == NOT(false)) { - assert(ND_low(aghead(e)) < M.getInt("nrows")); - assert(ND_low(agtail(e)) < M.getInt("ncols")); + assert(ND_low(aghead(e)) < M.nrows); + assert(ND_low(agtail(e)) < M.ncols); M.data[ND_low(aghead(e))][ND_low(agtail(e))]=1; delete_flat_edge(e); i--; @@ -1960,8 +1959,8 @@ try { continue; flat_rev(g, e); } else { - assert(ND_low(aghead(e)) < M.getInt("nrows")); - assert(ND_low(agtail(e)) < M.getInt("ncols")); + assert(ND_low(aghead(e)) < M.nrows); + assert(ND_low(agtail(e)) < M.ncols); M.data[ND_low(agtail(e))][ND_low(aghead(e))]=1; if (ND_mark(aghead(e)) == 0) flat_search(g, aghead(e)); @@ -1985,20 +1984,20 @@ try { ST_Agnode_s v; for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { flat = 0; - for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { - v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); + for (i = 0; i < GD_rank(g).get(r).n; i++) { + v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i); ND_mark(v, 0); ND_onstack(v, 0); ND_low(v, i); if ((ND_flat_out(v).size > 0) && (flat == 0)) { GD_rank(g).plus(r).setPtr("flat", - new_matrix(GD_rank(g).plus(r).getInt("n"), GD_rank(g).plus(r).getInt("n"))); + new_matrix(GD_rank(g).get(r).n, GD_rank(g).get(r).n)); flat = 1; } } if (flat!=0) { - for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { - v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); + for (i = 0; i < GD_rank(g).get(r).n; i++) { + v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i); if (ND_mark(v) == 0) flat_search(g, v); } @@ -2062,17 +2061,17 @@ ENTERING("3lxoqxhiri9fgt20zc5jz3aa5","install_in_rank"); try { int i, r; r = ND_rank(n); - i = GD_rank(g).plus(r).getInt("n"); - if (GD_rank(g).plus(r).getInt("an") <= 0) { + i = GD_rank(g).get(r).n; + if (GD_rank(g).get(r).an <= 0) { UNSUPPORTED("8qk1xhvvb994zhv9aq10k4v12"); // agerr(AGERR, "install_in_rank, line %d: %s %s rank %d i = %d an = 0\n", UNSUPPORTED("53h8d82ax23hys2k21hjswp72"); // 1034, agnameof(g), agnameof(n), r, i); return; } - GD_rank(g).plus(r).getPtr().v.plus(i).setPtr(n); + GD_rank(g).get(r).v.plus(i).setPtr(n); ND_order(n, i); - GD_rank(g).plus(r).setInt("n", 1+GD_rank(g).plus(r).getInt("n")); + GD_rank(g).plus(r).setInt("n", 1+GD_rank(g).get(r).n); // assert(GD_rank(g)[r].n <= GD_rank(g)[r].an); - if (ND_order(n) > GD_rank(Z.z().Root).plus(r).getInt("an")) { + if (ND_order(n) > GD_rank(Z.z().Root).get(r).an) { UNSUPPORTED("399szcw1txekt1xssyw7s2x07"); // agerr(AGERR, "install_in_rank, line %d: ND_order(%s) [%d] > GD_rank(Root)[%d].an [%d]\n", UNSUPPORTED("9puojrmsk6vb1qc0jtr8ge4g8"); // 1052, agnameof(n), ND_order(n), r, GD_rank(Root)[r].an); return; @@ -2082,8 +2081,8 @@ UNSUPPORTED("7o1thnqda767wqpe2lh9mj03t"); // agerr(AGERR, "install_in_rank, lin UNSUPPORTED("d2ugluzf7bmj7osicgitgy3sr"); // 1057, r, GD_minrank(g), GD_maxrank(g)); return; } - if (GD_rank(g).plus(r).getPtr("v").plus(ND_order(n)).comparePointer( - GD_rank(g).plus(r).getPtr("av").plus(GD_rank(Z.z().Root).plus(r).getInt("an")))>0) { + if (GD_rank(g).get(r).v.plus(ND_order(n)).comparePointer( + GD_rank(g).get(r).av.plus(GD_rank(Z.z().Root).get(r).an))>0) { UNSUPPORTED("3eb32nc5czs5auwzz5p5mtl04"); // agerr(AGERR, "install_in_rank, line %d: GD_rank(g)[%d].v + ND_order(%s) [%d] > GD_rank(g)[%d].av + GD_rank(Root)[%d].an [%d]\n", UNSUPPORTED("3qe3qpw5h6vse39xs1ca9sjmo"); // 1062, r, agnameof(n),GD_rank(g)[r].v + ND_order(n), r, r, GD_rank(g)[r].av+GD_rank(Root)[r].an); return; @@ -2131,13 +2130,13 @@ try { UNSUPPORTED("1b3hbd5artrq77i58q2o9kgz3"); // agerr(AGERR, "surprise\n"); for (i = GD_minrank(g); i <= GD_maxrank(g); i++) { GD_rank(Z.z().Root).plus(i).setInt("valid", 0); - if (GD_flip(g)!=0 && (GD_rank(g).plus(i).getInt("n") > 0)) { + if (GD_flip(g)!=0 && (GD_rank(g).get(i).n > 0)) { int nn, ndiv2; - __ptr__ vlist = GD_rank(g).plus(i).getPtr("v"); - nn = GD_rank(g).plus(i).getInt("n") - 1; + ST_Agnode_s.ArrayOfStar vlist = GD_rank(g).get(i).v; + nn = GD_rank(g).get(i).n - 1; ndiv2 = nn / 2; for (j = 0; j <= ndiv2; j++) - exchange((ST_Agnode_s)vlist.plus(j).getPtr(), (ST_Agnode_s)vlist.plus(nn - j).getPtr()); + exchange((ST_Agnode_s)vlist.get(j), (ST_Agnode_s)vlist.plus(nn - j).getPtr()); } } if (EQ(g, dot_root(g)) && ncross(g) > 0) @@ -2239,16 +2238,16 @@ try { if (GD_has_flat_edges(g) == 0) return; for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { - if (GD_rank(g).plus(r).getInt("n") == 0) continue; - base_order = ND_order(GD_rank(g).plus(r).getPtr().v.plus(0).getPtr()); - for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) - ND_mark(GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(), 0); + if (GD_rank(g).get(r).n == 0) continue; + base_order = ND_order(GD_rank(g).get(r).v.get(0)); + for (i = 0; i < GD_rank(g).get(r).n; i++) + ND_mark(GD_rank(g).get(r).v.get(i), 0); temprank = ALLOC_Agnode_s(i + 1, temprank); pos = 0; /* construct reverse topological sort order in temprank */ - for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { - if (GD_flip(g)!=0) v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); - else v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(GD_rank(g).plus(r).getInt("n") - i - 1).getPtr(); + for (i = 0; i < GD_rank(g).get(r).n; i++) { + if (GD_flip(g)!=0) v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i); + else v = (ST_Agnode_s) GD_rank(g).get(r).v.plus(GD_rank(g).get(r).n - i - 1).getPtr(); local_in_cnt = local_out_cnt = 0; for (j = 0; j < ND_flat_in(v).size; j++) { flat_e = (ST_Agedge_s) ND_flat_in(v).getFromList(j); @@ -2280,14 +2279,14 @@ try { right = right.plus(-1); } } - for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { - v = (ST_Agnode_s) temprank.plus(i).getPtr(); - GD_rank(g).plus(r).getPtr().v.plus(i).setPtr(v); + for (i = 0; i < GD_rank(g).get(r).n; i++) { + v = (ST_Agnode_s) temprank.get(i); + GD_rank(g).get(r).v.plus(i).setPtr(v); ND_order(v, i + base_order); } /* nonconstraint flat edges must be made LR */ - for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { - v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); + for (i = 0; i < GD_rank(g).get(r).n; i++) { + v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i); if (ND_flat_out(v).listNotNull()) { for (j = 0; (e = (ST_Agedge_s) ND_flat_out(v).getFromList(j))!=null; j++) { if ( ((GD_flip(g) == 0) && (ND_order(aghead(e)) < ND_order(agtail(e)))) || @@ -2323,9 +2322,9 @@ try { boolean changed = false; int nelt; boolean muststay, sawclust; - __ptr__ vlist = GD_rank(g).plus(r).getPtr("v"); - __ptr__ lp, rp=null, ep = vlist.plus(GD_rank(g).plus(r).getInt("n")); - for (nelt = GD_rank(g).plus(r).getInt("n") - 1; nelt >= 0; nelt--) { + __ptr__ vlist = GD_rank(g).get(r).v; + __ptr__ lp, rp=null, ep = vlist.plus(GD_rank(g).get(r).n); + for (nelt = GD_rank(g).get(r).n - 1; nelt >= 0; nelt--) { lp = vlist; while (lp.comparePointer(ep)<0) { /* find leftmost node that can be compared */ @@ -2363,7 +2362,7 @@ try { ep = ep.plus(-1); } if (changed) { - GD_rank(Z.z().Root).plus(r).getPtr().valid= 0; + GD_rank(Z.z().Root).get(r).valid= 0; if (r > 0) GD_rank(Z.z().Root).plus(r - 1).getPtr().valid= 0; } @@ -2473,38 +2472,38 @@ ENTERING("bk5nklhfqgg0uwkv7tv6dn8r2","rcross"); try { int top, bot, cross, max, i, k; ST_Agnode_s v; - __ptr__ rtop; + ST_Agnode_s.ArrayOfStar rtop; cross = 0; max = 0; - rtop = GD_rank(g).plus(r).getPtr("v"); - if (Z.z().C <= GD_rank(Z.z().Root).plus(r + 1).getInt("n")) { - Z.z().C = GD_rank(Z.z().Root).plus(r + 1).getInt("n") + 1; + rtop = GD_rank(g).get(r).v; + if (Z.z().C <= GD_rank(Z.z().Root).plus(r + 1).getPtr().n) { + Z.z().C = GD_rank(Z.z().Root).plus(r + 1).getPtr().n + 1; Z.z().Count = ALLOC_INT(Z.z().C, Z.z().Count); } - for (i = 0; i < GD_rank(g).plus(r + 1).getInt("n"); i++) + for (i = 0; i < GD_rank(g).get(r + 1).n; i++) Z.z().Count.plus(i).setInt(0); - for (top = 0; top < GD_rank(g).plus(r).getInt("n"); top++) { + for (top = 0; top < GD_rank(g).get(r).n; top++) { ST_Agedge_s e; if (max > 0) { - for (i = 0; (e = (ST_Agedge_s) ND_out(rtop.plus(top).getPtr()).getFromList(i))!=null; i++) { + for (i = 0; (e = (ST_Agedge_s) ND_out(rtop.get(top)).getFromList(i))!=null; i++) { for (k = ND_order(aghead(e)) + 1; k <= max; k++) cross += Z.z().Count.plus(k).getInt() * ED_xpenalty(e); } } - for (i = 0; (e = (ST_Agedge_s) ND_out(rtop.plus(top).getPtr()).getFromList(i))!=null; i++) { + for (i = 0; (e = (ST_Agedge_s) ND_out(rtop.get(top)).getFromList(i))!=null; i++) { int inv = ND_order(aghead(e)); if (inv > max) max = inv; Z.z().Count.plus(inv).setInt(Z.z().Count.plus(inv).getInt() + ED_xpenalty(e)); } } - for (top = 0; top < GD_rank(g).plus(r).getInt("n"); top++) { - v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(top).getPtr(); + for (top = 0; top < GD_rank(g).get(r).n; top++) { + v = (ST_Agnode_s) GD_rank(g).get(r).v.get(top); if (ND_has_port(v)) cross += local_cross(ND_out(v), 1); } - for (bot = 0; bot < GD_rank(g).plus(r + 1).getInt("n"); bot++) { - v = (ST_Agnode_s) GD_rank(g).plus(r + 1).getPtr().v.plus(bot).getPtr(); + for (bot = 0; bot < GD_rank(g).get(r + 1).n; bot++) { + v = (ST_Agnode_s) GD_rank(g).get(r + 1).v.get(bot); if (ND_has_port(v)) cross += local_cross(ND_in(v), -1); } @@ -2526,11 +2525,11 @@ try { g = Z.z().Root; count = 0; for (r = GD_minrank(g); r < GD_maxrank(g); r++) { - if (GD_rank(g).plus(r).getPtr().valid!=0) - count += GD_rank(g).plus(r).getInt("cache_nc"); + if (GD_rank(g).get(r).valid!=0) + count += GD_rank(g).get(r).cache_nc; else { nc = rcross(g, r); - GD_rank(g).plus(r).getInt("cache_nc"); + GD_rank(g).get(r).cache_nc = nc; count += nc; GD_rank(g).plus(r).setInt("valid", 1); } @@ -2605,22 +2604,22 @@ try { int i, j, j0, lm, rm, lspan, rspan; __ptr__ list; ST_Agnode_s n; - __ptr__ v; + ST_Agnode_s.ArrayOfStar v; ST_Agedge_s e; boolean hasfixed = false; list = Z.z().TI_list; - v = GD_rank(g).plus(r0).getPtr("v"); - for (i = 0; i < GD_rank(g).plus(r0).getInt("n"); i++) { - n = (ST_Agnode_s) v.plus(i).getPtr(); + v = GD_rank(g).get(r0).v; + for (i = 0; i < GD_rank(g).get(r0).n; i++) { + n = (ST_Agnode_s) v.get(i); j = 0; if (r1 > r0) for (j0 = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(j0))!=null; j0++) { if (ED_xpenalty(e) > 0) - list.plus(j++).setInt((256 * ND_order(aghead(e)) + (ED_head_port(e)).getInt("order"))); + list.plus(j++).setInt((256 * ND_order(aghead(e)) + (ED_head_port(e)).order)); } else for (j0 = 0; (e = (ST_Agedge_s) ND_in(n).getFromList(j0))!=null; j0++) { if (ED_xpenalty(e) > 0) - list.plus(j++).setInt((256 * ND_order(agtail(e)) + (ED_tail_port(e)).getInt("order"))); + list.plus(j++).setInt((256 * ND_order(agtail(e)) + (ED_tail_port(e)).order)); } switch (j) { case 0: @@ -2653,8 +2652,8 @@ try { } } } - for (i = 0; i < GD_rank(g).plus(r0).getInt("n"); i++) { - n = (ST_Agnode_s) v.plus(i).getPtr(); + for (i = 0; i < GD_rank(g).get(r0).n; i++) { + n = (ST_Agnode_s) v.get(i); if ((ND_out(n).size == 0) && (ND_in(n).size == 0)) hasfixed |= flat_mval(n); } diff --git a/src/gen/lib/dotgen/position__c.java b/src/gen/lib/dotgen/position__c.java index 3a4c8f8c7..a78bf7457 100644 --- a/src/gen/lib/dotgen/position__c.java +++ b/src/gen/lib/dotgen/position__c.java @@ -144,7 +144,6 @@ import h.ratio_t; import smetana.core.CString; import smetana.core.Memory; import smetana.core.Z; -import smetana.core.__ptr__; public class position__c { //1 2digov3edok6d5srhgtlmrycs @@ -471,8 +470,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -803,8 +802,8 @@ try { rp = GD_rank(g).plus(r); found =0; tp = null; - for (i = 0; i < rp.getPtr().getInt("n"); i++) { - tp = (ST_Agnode_s) rp.getPtr().v.plus(i).getPtr(); + for (i = 0; i < rp.getPtr().n; i++) { + tp = (ST_Agnode_s) rp.getPtr().v.get(i); if (ND_save_out(tp).listNotNull()) { for (j = 0; (e = (ST_Agedge_s) ND_save_out(tp).getFromList(j))!=null; j++) { if ((ND_rank(aghead(e)) > r) || (ND_rank(agtail(e)) > r)) { @@ -825,9 +824,9 @@ try { } } if (found!=0 || N(tp)) continue; - tp = (ST_Agnode_s) rp.getPtr().v.plus(0).getPtr(); - if (r < GD_maxrank(g)) hp = (ST_Agnode_s) rp.plus(1).getPtr().v.plus(0).getPtr(); - else hp = (ST_Agnode_s) rp.plus(-1).getPtr().v.plus(0).getPtr(); + tp = (ST_Agnode_s) rp.getPtr().v.get(0); + if (r < GD_maxrank(g)) hp = (ST_Agnode_s) rp.get(1).v.get(0); + else hp = (ST_Agnode_s) rp.plus(-1).getPtr().v.get(0); //assert (hp); sn = virtual_node(g); ND_node_type(sn, 2); @@ -1006,11 +1005,11 @@ try { /* make edges to constrain left-to-right ordering */ for (i = GD_minrank(g); i <= GD_maxrank(g); i++) { double last; - ND_rank(rank.plus(i).getPtr().v.plus(0).getPtr(), 0); + ND_rank(rank.get(i).v.get(0), 0); last = 0; nodesep = sep[i & 1]; - for (j = 0; j < rank.plus(i).getInt("n"); j++) { - u = (ST_Agnode_s) rank.plus(i).getPtr().v.plus(j).getPtr(); + for (j = 0; j < rank.get(i).n; j++) { + u = (ST_Agnode_s) rank.get(i).v.get(j); ND_mval(u, ND_rw(u)); /* keep it somewhere safe */ if (ND_other(u).size > 0) { /* compute self size */ /* FIX: dot assumes all self-edges go to the right. This @@ -1029,7 +1028,7 @@ try { } ND_rw(u, ND_rw(u) + sw); /* increment to include self edges */ } - v = (ST_Agnode_s) rank.plus(i).getPtr().v.plus(j + 1).getPtr(); + v = (ST_Agnode_s) rank.get(i).v.plus(j + 1).getPtr(); if (v!=null) { width = ND_rw(u) + ND_lw(v) + nodesep; e0 = make_aux_edge(u, v, width, 0); @@ -1150,7 +1149,7 @@ try { make_aux_edge(GD_ln(g), GD_rn(g), 1, 128); /* clust compaction edge */ } for (c = 1; c <= GD_n_cluster(g); c++) - contain_clustnodes((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); + contain_clustnodes((ST_Agraph_s) GD_clust(g).get(c).getPtr()); } finally { LEAVING("79v3omwzni0nm3h05l3onjsbz","contain_clustnodes"); } @@ -1190,22 +1189,22 @@ try { ST_Agnode_s u, v; margin = late_int (g, Z.z().G_margin, 8, 0); for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { - if (GD_rank(g).plus(r).getInt("n") == 0) + if (GD_rank(g).get(r).n == 0) continue; - v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(0).getPtr(); + v = (ST_Agnode_s) GD_rank(g).get(r).v.get(0); if (v == null) continue; for (i = ND_order(v) - 1; i >= 0; i--) { - u = (ST_Agnode_s) GD_rank(dot_root(g)).plus(r).getPtr().v.plus(i).getPtr(); + u = (ST_Agnode_s) GD_rank(dot_root(g)).get(r).v.get(i); /* can't use "is_a_vnode_of" because elists are swapped */ if ((ND_node_type(u) == 0) || vnode_not_related_to(g, u)) { make_aux_edge(u, GD_ln(g), margin + ND_rw(u), 0); break; } } - for (i = ND_order(v) + GD_rank(g).plus(r).getInt("n"); i < GD_rank(dot_root(g)).plus(r).getInt("n"); + for (i = ND_order(v) + GD_rank(g).get(r).n; i < GD_rank(dot_root(g)).get(r).n; i++) { - u = (ST_Agnode_s) GD_rank(dot_root(g)).plus(r).getPtr().v.plus(i).getPtr(); + u = (ST_Agnode_s) GD_rank(dot_root(g)).get(r).v.get(i); if ((ND_node_type(u) == 0) || vnode_not_related_to(g, u)) { make_aux_edge(GD_rn(g), u, margin + ND_lw(u), 0); break; @@ -1213,7 +1212,7 @@ try { } } for (c = 1; c <= GD_n_cluster(g); c++) - keepout_othernodes((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); + keepout_othernodes((ST_Agraph_s) GD_clust(g).get(c).getPtr()); } finally { LEAVING("73cdgjl47ohty2va766evbo4","keepout_othernodes"); } @@ -1232,12 +1231,12 @@ try { margin = late_int (g, Z.z().G_margin, 8, 0); make_lrvn(g); for (c = 1; c <= GD_n_cluster(g); c++) { - subg = (ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(); + subg = (ST_Agraph_s) GD_clust(g).get(c).getPtr(); make_lrvn(subg); make_aux_edge(GD_ln(g), GD_ln(subg), - margin + GD_border(g)[3].getDouble("x"), 0); + margin + GD_border(g)[3].x, 0); make_aux_edge(GD_rn(subg), GD_rn(g), - margin + GD_border(g)[1].getDouble("x"), 0); + margin + GD_border(g)[1].x, 0); contain_subclust(subg); } } finally { @@ -1258,11 +1257,11 @@ try { ST_Agraph_s left, right; margin = late_int (g, Z.z().G_margin, 8, 0); for (i = 1; i <= GD_n_cluster(g); i++) - make_lrvn((ST_Agraph_s) GD_clust(g).plus(i).getPtr().getPtr()); + make_lrvn((ST_Agraph_s) GD_clust(g).get(i).getPtr()); for (i = 1; i <= GD_n_cluster(g); i++) { for (j = i + 1; j <= GD_n_cluster(g); j++) { - low = (ST_Agraph_s) GD_clust(g).plus(i).getPtr().getPtr(); - high = (ST_Agraph_s) GD_clust(g).plus(j).getPtr().getPtr(); + low = (ST_Agraph_s) GD_clust(g).get(i).getPtr(); + high = (ST_Agraph_s) GD_clust(g).get(j).getPtr(); if (GD_minrank(low) > GD_minrank(high)) { ST_Agraph_s temp = low; low = high; @@ -1270,8 +1269,8 @@ try { } if (GD_maxrank(low) < GD_minrank(high)) continue; - if (ND_order(GD_rank(low).plus(GD_minrank(high)).getPtr("v").plus(0).getPtr()) - < ND_order(GD_rank(high).plus(GD_minrank(high)).getPtr("v").plus(0).getPtr())) { + if (ND_order(GD_rank(low).get(GD_minrank(high)).v.get(0)) + < ND_order(GD_rank(high).get(GD_minrank(high)).v.get(0))) { left = low; right = high; } else { @@ -1280,7 +1279,7 @@ try { } make_aux_edge(GD_rn(left), GD_ln(right), margin, 0); } - separate_subclust((ST_Agraph_s) GD_clust(g).plus(i).getPtr().getPtr()); + separate_subclust((ST_Agraph_s) GD_clust(g).get(i).getPtr()); } } finally { LEAVING("6oruu1p1b7kxr5moh3kmcmvr3","separate_subclust"); @@ -1316,7 +1315,7 @@ ENTERING("fywsxto7yvl5wa2dfu7u7jj1","compress_graph"); try { double x; ST_pointf p = new ST_pointf(); - if (GD_drawing(g).getInt("ratio_kind") != enumAsInt(ratio_t.class, "R_COMPRESS")) + if (GD_drawing(g).ratio_kind != enumAsInt(ratio_t.class, "R_COMPRESS")) return; UNSUPPORTED("79oeaf0u32si2chjcpas5whjl"); // p = GD_drawing(g)->size; UNSUPPORTED("6a2ue1i6kvwvpgapb4z8l27jn"); // if (p.x * p.y <= 1) @@ -1411,8 +1410,8 @@ try { ST_Agnode_s v; ST_rank_t.Array2 rank = GD_rank(g); for (i = GD_minrank(g); i <= GD_maxrank(g); i++) { - for (j = 0; j < rank.plus(i).getInt("n"); j++) { - v = (ST_Agnode_s) rank.plus(i).getPtr().v.plus(j).getPtr(); + for (j = 0; j < rank.get(i).n; j++) { + v = (ST_Agnode_s) rank.get(i).v.get(j); ND_coord(v).x = ND_rank(v); ND_rank(v, i); } @@ -1520,7 +1519,7 @@ try { int c; double ht1, ht2; ST_Agraph_s subg; - __ptr__ rank = GD_rank(dot_root(g)); + ST_rank_t.Array2 rank = GD_rank(dot_root(g)); int margin, haveClustLabel = 0; if (EQ(g, dot_root(g))) margin = 8; @@ -1530,7 +1529,7 @@ try { ht2 = GD_ht2(g); /* account for sub-clusters */ for (c = 1; c <= GD_n_cluster(g); c++) { - subg = (ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(); + subg = (ST_Agraph_s) GD_clust(g).get(c).getPtr(); haveClustLabel |= clust_ht(subg); if (GD_maxrank(subg) == GD_maxrank(g)) ht1 = MAX(ht1, GD_ht1(subg) + margin); @@ -1542,16 +1541,16 @@ try { if (NEQ(g, dot_root(g)) && GD_label(g)!=null) { haveClustLabel = 1; if (N(GD_flip(agroot(g)))) { - ht1 += GD_border(g)[0].getDouble("y"); - ht2 += GD_border(g)[2].getDouble("y"); + ht1 += GD_border(g)[0].y; + ht2 += GD_border(g)[2].y; } } GD_ht1(g, ht1); GD_ht2(g, ht2); /* update the global ranks */ if (NEQ(g, dot_root(g))) { - rank.plus(GD_minrank(g)).setDouble("ht2", MAX(rank.plus(GD_minrank(g)).getDouble("ht2"), ht2)); - rank.plus(GD_maxrank(g)).setDouble("ht1", MAX(rank.plus(GD_maxrank(g)).getDouble("ht1"), ht1)); + rank.plus(GD_minrank(g)).setDouble("ht2", MAX(rank.get(GD_minrank(g)).ht2, ht2)); + rank.plus(GD_maxrank(g)).setDouble("ht1", MAX(rank.get(GD_maxrank(g)).ht1, ht1)); } return haveClustLabel; } finally { @@ -1577,8 +1576,8 @@ try { ht2 = maxht = 0; /* scan ranks for tallest nodes. */ for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { - for (i = 0; i < rank.plus(r).getInt("n"); i++) { - n = (ST_Agnode_s) rank.plus(r).getPtr().v.plus(i).getPtr(); + for (i = 0; i < rank.get(r).n; i++) { + n = (ST_Agnode_s) rank.get(r).v.get(i); /* assumes symmetry, ht1 = ht2 */ ht2 = ND_ht(n) / 2; /* have to look for high self-edge labels, too */ @@ -1586,15 +1585,15 @@ try { for (j = 0; (e = (ST_Agedge_s) ND_other(n).getFromList(j))!=null; j++) { if (EQ(agtail(e), aghead(e))) { if (ED_label(e)!=null) - ht2 = MAX(ht2, ED_label(e).dimen.getDouble("y") / 2); + ht2 = MAX(ht2, ED_label(e).dimen.y / 2); } } /* update global rank ht */ - if (rank.plus(r).getDouble("pht2") < ht2) { + if (rank.get(r).pht2 < ht2) { rank.plus(r).setDouble("ht2", ht2); rank.plus(r).setDouble("pht2", ht2); } - if (rank.plus(r).getDouble("pht1") < ht2) { + if (rank.get(r).pht1 < ht2) { rank.plus(r).setDouble("ht1", ht2); rank.plus(r).setDouble("pht1", ht2); } @@ -1613,13 +1612,13 @@ try { /* make the initial assignment of ycoords to leftmost nodes by ranks */ maxht = 0; r = GD_maxrank(g); - (ND_coord(rank.plus(r).getPtr().v.plus(0).getPtr())).setDouble("y", rank.plus(r).getDouble("ht1")); + (ND_coord(rank.get(r).v.get(0))).setDouble("y", rank.get(r).ht1); while (--r >= GD_minrank(g)) { - d0 = rank.plus(r + 1).getDouble("pht2") + rank.plus(r).getDouble("pht1") + GD_ranksep(g); /* prim node sep */ - d1 = rank.plus(r + 1).getDouble("ht2") + rank.plus(r).getDouble("ht1") + 8; /* cluster sep */ + d0 = rank.get(r + 1).pht2 + rank.get(r).pht1 + GD_ranksep(g); /* prim node sep */ + d1 = rank.get(r + 1).ht2 + rank.get(r).ht1 + 8; /* cluster sep */ delta = MAX(d0, d1); - if (rank.plus(r).getInt("n") > 0) /* this may reflect some problem */ - (ND_coord(rank.plus(r).getPtr().v.plus(0).getPtr())).setDouble("y", (ND_coord(rank.plus(r + 1).getPtr().v.plus(0).getPtr())).getDouble("y") + delta); + if (rank.get(r).n > 0) /* this may reflect some problem */ + (ND_coord(rank.get(r).v.get(0))).setDouble("y", (ND_coord(rank.plus(r + 1).getPtr().v.get(0))).y + delta); maxht = MAX(maxht, delta); } /* If there are cluster labels and the drawing is rotated, we need special processing to @@ -1650,7 +1649,7 @@ UNSUPPORTED("e6dfx5uesysjaefb0djyfp7f"); // (ND_coord(rank[r + 1].v[0])).y } /* copy ycoord assignment from leftmost nodes to others */ for (n = GD_nlist(g); n!=null; n = ND_next(n)) - ND_coord(n).y = ND_coord(rank.plus(ND_rank(n)).getPtr().v.plus(0).getPtr()).getDouble("y"); + ND_coord(n).y = ND_coord(rank.plus(ND_rank(n)).getPtr().v.get(0)).y; } finally { LEAVING("bp8vmol4ncadervcfossysdtd","set_ycoords"); } @@ -1673,23 +1672,23 @@ try { LL.x = INT_MAX; UR.x = -((double)INT_MAX); for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { - int rnkn = GD_rank(g).plus(r).getInt("n"); + int rnkn = GD_rank(g).get(r).n; if (rnkn == 0) continue; - if ((v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(0).getPtr()) == null) + if ((v = (ST_Agnode_s) GD_rank(g).get(r).v.get(0)) == null) continue; for (c = 1; (ND_node_type(v) != 0) && c < rnkn; c++) - v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(c).getPtr(); + v = (ST_Agnode_s) GD_rank(g).get(r).v.get(c); if (ND_node_type(v) == 0) { - x = ND_coord(v).getDouble("x") - ND_lw(v); + x = ND_coord(v).x - ND_lw(v); LL.setDouble("x", MIN(LL.x, x)); } else continue; /* At this point, we know the rank contains a NORMAL node */ - v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(rnkn - 1).getPtr(); + v = (ST_Agnode_s) GD_rank(g).get(r).v.plus(rnkn - 1).getPtr(); for (c = rnkn-2; ND_node_type(v) != 0; c--) - v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(c).getPtr(); - x = ND_coord(v).getDouble("x") + ND_rw(v); + v = (ST_Agnode_s) GD_rank(g).get(r).v.get(c); + x = ND_coord(v).x + ND_rw(v); UR.x = MAX(UR.x, x); } offset = 8; @@ -1703,8 +1702,8 @@ try { LL.x = (double)(ND_rank(GD_ln(g))); UR.x = (double)(ND_rank(GD_rn(g))); } - LL.y = ND_coord(GD_rank(root).plus(GD_maxrank(g)).getPtr().v.plus(0).getPtr()).getDouble("y") - GD_ht1(g); - UR.y = ND_coord(GD_rank(root).plus(GD_minrank(g)).getPtr().v.plus(0).getPtr()).getDouble("y") + GD_ht2(g); + LL.y = ND_coord(GD_rank(root).plus(GD_maxrank(g)).getPtr().v.get(0)).y - GD_ht1(g); + UR.y = ND_coord(GD_rank(root).plus(GD_minrank(g)).getPtr().v.get(0)).y + GD_ht2(g); GD_bb(g).setStruct("LL", LL); GD_bb(g).setStruct("UR", UR); } finally { @@ -1723,7 +1722,7 @@ ENTERING("dlbpiimh9g9ff9w7wjoabf817","rec_bb"); try { int c; for (c = 1; c <= GD_n_cluster(g); c++) - rec_bb((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(), root); + rec_bb((ST_Agraph_s) GD_clust(g).get(c).getPtr(), root); dot_compute_bb(g, root); } finally { LEAVING("dlbpiimh9g9ff9w7wjoabf817","rec_bb"); @@ -1794,7 +1793,7 @@ try { boolean scale_it, filled; ST_point sz = new ST_point(); rec_bb(g, g); - if ((GD_maxrank(g) > 0) && (GD_drawing(g).getInt("ratio_kind")!=0)) { + if ((GD_maxrank(g) > 0) && (GD_drawing(g).ratio_kind!=0)) { UNSUPPORTED("5wbmy4x78flo2ztfabki9lyjf"); // sz.x = GD_bb(g).UR.x - GD_bb(g).LL.x; UNSUPPORTED("catd6eu5oc282ln95k9zz52f3"); // sz.y = GD_bb(g).UR.y - GD_bb(g).LL.y; /* normalize */ UNSUPPORTED("21zvq2qx1j34j1i1879zyhzpj"); // if (GD_flip(g)) { @@ -1921,23 +1920,23 @@ try { ST_Agnode_s v; for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { j = 0; - for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { - v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); + for (i = 0; i < GD_rank(g).get(r).n; i++) { + v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i); ND_order(v, j); if (ND_ranktype(v) == 6) j = j + ND_UF_size(v); else j++; } - if (j <= GD_rank(g).plus(r).getInt("n")) + if (j <= GD_rank(g).get(r).n) continue; - GD_rank(g).plus(r).setPtr("v", ALLOC_allocated_ST_Agnode_s((ST_Agnode_s.ArrayOfStar) GD_rank(g).plus(r).getPtr("v"), j + 1)); - for (i = GD_rank(g).plus(r).getInt("n") - 1; i >= 0; i--) { - v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); - GD_rank(g).plus(r).getPtr().v.plus(ND_order(v)).setPtr(v); + GD_rank(g).plus(r).setPtr("v", ALLOC_allocated_ST_Agnode_s((ST_Agnode_s.ArrayOfStar) GD_rank(g).get(r).v, j + 1)); + for (i = GD_rank(g).get(r).n - 1; i >= 0; i--) { + v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i); + GD_rank(g).get(r).v.plus(ND_order(v)).setPtr(v); } GD_rank(g).plus(r).setInt("n", j); - GD_rank(g).plus(r).getPtr().v.plus(j).setPtr(null); + GD_rank(g).get(r).v.plus(j).setPtr(null); } } finally { LEAVING("1lejhh3evsa10auyj7cgqj8ub","make_leafslots"); @@ -2061,7 +2060,7 @@ try { rn = virtual_node(dot_root(g)); ND_node_type(rn, 2); if (GD_label(g)!=null && NEQ(g, dot_root(g)) && N(GD_flip(agroot(g)))) { - int w = MAX((int)GD_border(g)[0].getDouble("x"), (int)GD_border(g)[2].getDouble("x")); + int w = MAX((int)GD_border(g)[0].x, (int)GD_border(g)[2].x); make_aux_edge(ln, rn, w, 0); } GD_ln(g, ln); @@ -2086,19 +2085,19 @@ try { ln = GD_ln(g); rn = GD_rn(g); for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { - if (GD_rank(g).plus(r).getInt("n") == 0) + if (GD_rank(g).get(r).n == 0) continue; - v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(0).getPtr(); + v = (ST_Agnode_s) GD_rank(g).get(r).v.get(0); if (v == null) { UNSUPPORTED("1f2esoodtcrdhljk1cq1klyao"); // agerr(AGERR, "contain_nodes clust %s rank %d missing node\n", UNSUPPORTED("7w6lv4ywtczwz2y1mg0p3jdav"); // agnameof(g), r); UNSUPPORTED("6hqli9m8yickz1ox1qfgtdbnd"); // continue; } make_aux_edge(ln, v, - ND_lw(v) + margin + GD_border(g)[3].getDouble("x"), 0); - v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(GD_rank(g).plus(r).getInt("n") - 1).getPtr(); + ND_lw(v) + margin + GD_border(g)[3].x, 0); + v = (ST_Agnode_s) GD_rank(g).get(r).v.plus(GD_rank(g).get(r).n - 1).getPtr(); make_aux_edge(v, rn, - ND_rw(v) + margin + GD_border(g)[1].getDouble("x"), 0); + ND_rw(v) + margin + GD_border(g)[1].x, 0); } } finally { LEAVING("daz786541idcxnywckcbncazb","contain_nodes"); diff --git a/src/gen/lib/dotgen/rank__c.java b/src/gen/lib/dotgen/rank__c.java index 6fc65945e..f47309eeb 100644 --- a/src/gen/lib/dotgen/rank__c.java +++ b/src/gen/lib/dotgen/rank__c.java @@ -101,14 +101,14 @@ import static smetana.core.Macro.ND_out; import static smetana.core.Macro.ND_rank; import static smetana.core.Macro.ND_ranktype; import static smetana.core.Macro.UNSUPPORTED; -import static smetana.core.Macro.*; +import static smetana.core.Macro.ZALLOC_ST_Agraph_s; import h.ST_Agedge_s; import h.ST_Agnode_s; import h.ST_Agraph_s; import h.ST_aspect_t; +import h.ST_elist; import h.ST_point; import h.ST_pointf; -import h.ST_elist; import smetana.core.CString; import smetana.core.Memory; import smetana.core.Z; @@ -438,8 +438,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -929,7 +929,7 @@ try { continue; } for (i = 1; i < GD_n_cluster(par); i++) - if (agcontains((ST_Agraph_s) GD_clust(par).plus(i).getPtr().getPtr(), n)) + if (agcontains((ST_Agraph_s) GD_clust(par).get(i).getPtr(), n)) break; if (i < GD_n_cluster(par)) agdelete(g, n); @@ -1088,7 +1088,7 @@ try { GD_minrank(g, GD_minrank(g) + ND_rank(GD_leader(g))); GD_maxrank(g, GD_maxrank(g) + ND_rank(GD_leader(g))); for (c = 1; c <= GD_n_cluster(g); c++) - set_minmax((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); + set_minmax((ST_Agraph_s) GD_clust(g).get(c).getPtr()); } finally { LEAVING("12fw0esv4unfin6waf9mknc1o","set_minmax"); } @@ -1190,7 +1190,7 @@ try { if ((s = agget(g, new CString("nslimit1")))!=null) UNSUPPORTED("9tp2zk1tsr4ce9rwsr0is9u3o"); // maxiter = atof(s) * agnnodes(g); for (c = 0; c < GD_comp(g).size; c++) { - //GD_nlist(g, GD_comp(g).list.plus(c).getPtr()); + //GD_nlist(g, GD_comp(g).list.get(c)); GD_nlist(g, GD_comp(g).getFromList(c)); rank(g, (GD_n_cluster(g) == 0 ? 1 : 0), maxiter); /* TB balance */ } @@ -1230,7 +1230,7 @@ try { if (EQ(g, dot_root(g))) { if (Z.z().CL_type == 100) { for (c = 1; c <= GD_n_cluster(g); c++) - set_minmax((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); + set_minmax((ST_Agraph_s) GD_clust(g).get(c).getPtr()); } else { find_clusters(g); } diff --git a/src/gen/lib/dotgen/sameport__c.java b/src/gen/lib/dotgen/sameport__c.java index 3ec4e21c7..71ff710e9 100644 --- a/src/gen/lib/dotgen/sameport__c.java +++ b/src/gen/lib/dotgen/sameport__c.java @@ -380,8 +380,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/fdpgen/clusteredges__c.java b/src/gen/lib/fdpgen/clusteredges__c.java index 714ad8bbe..4626a952e 100644 --- a/src/gen/lib/fdpgen/clusteredges__c.java +++ b/src/gen/lib/fdpgen/clusteredges__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/fdpgen/comp__c.java b/src/gen/lib/fdpgen/comp__c.java index 985979cd7..6f2c75a34 100644 --- a/src/gen/lib/fdpgen/comp__c.java +++ b/src/gen/lib/fdpgen/comp__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/fdpgen/fdpinit__c.java b/src/gen/lib/fdpgen/fdpinit__c.java index 2ff124b3d..f92b6b79b 100644 --- a/src/gen/lib/fdpgen/fdpinit__c.java +++ b/src/gen/lib/fdpgen/fdpinit__c.java @@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/fdpgen/grid__c.java b/src/gen/lib/fdpgen/grid__c.java index 233dd382e..8ec504994 100644 --- a/src/gen/lib/fdpgen/grid__c.java +++ b/src/gen/lib/fdpgen/grid__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/fdpgen/layout__c.java b/src/gen/lib/fdpgen/layout__c.java index 1432b67ac..ea6735b99 100644 --- a/src/gen/lib/fdpgen/layout__c.java +++ b/src/gen/lib/fdpgen/layout__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/fdpgen/tlayout__c.java b/src/gen/lib/fdpgen/tlayout__c.java index d09055a97..46c4a9f54 100644 --- a/src/gen/lib/fdpgen/tlayout__c.java +++ b/src/gen/lib/fdpgen/tlayout__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/fdpgen/xlayout__c.java b/src/gen/lib/fdpgen/xlayout__c.java index 3a636df97..4eeac708a 100644 --- a/src/gen/lib/fdpgen/xlayout__c.java +++ b/src/gen/lib/fdpgen/xlayout__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/gvc/gvlayout__c.java b/src/gen/lib/gvc/gvlayout__c.java index 9815dd772..1fb4ac2b0 100644 --- a/src/gen/lib/gvc/gvlayout__c.java +++ b/src/gen/lib/gvc/gvlayout__c.java @@ -196,10 +196,10 @@ try { // plugin = gvplugin_load(gvc, API_layout, layout); // if (plugin) { // typeptr = plugin->typeptr; - gvc.getStruct("layout").setPtr("type", typeptr.getPtr("type")); - gvc.getStruct("layout").setPtr("engine", typeptr.getPtr("engine")); - gvc.getStruct("layout").setInt("id", typeptr.getInt("id")); - gvc.getStruct("layout").setPtr("features", typeptr.getPtr("features")); + gvc.layout.setPtr("type", typeptr.type); + gvc.layout.setPtr("engine", typeptr.engine); + gvc.layout.setInt("id", typeptr.id); + gvc.layout.setPtr("features", typeptr.features); return 300; /* FIXME - need better return code */ // } // return 999; @@ -235,18 +235,18 @@ UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // } rc = gvlayout_select(gvc, p); //Let's force things - gvle = (ST_gvlayout_engine_s) gvc.getStruct("layout").getPtr("engine"); + gvle = (ST_gvlayout_engine_s) gvc.layout.engine; if (N(gvle)) UNSUPPORTED("return -1;"); gv_fixLocale (1); - graph_init(g, (gvc.getStruct("layout").getPtr("features").getInt("flags") & (1<<0))!=0); + graph_init(g, (gvc.layout.features.flags & (1<<0))!=0); GD_drawing(agroot(g), GD_drawing(g)); - if (gvle!=null && gvle.getPtr("layout")!=null) { - gvle.call("layout", g); - if (gvle.getPtr("cleanup")!=null) + if (gvle!=null && gvle.layout!=null) { + gvle.layout.exe(g); + if (gvle.cleanup!=null) if (GD_cleanup(g)==null) LOG2("WARNING WE CHEAT GD_cleanup(g) is NULL"); else - GD_cleanup(g).setPtr(gvle.getPtr("cleanup")); + GD_cleanup(g).setPtr(gvle.cleanup); } gv_fixLocale (0); return 0; diff --git a/src/gen/lib/gvc/gvrender__c.java b/src/gen/lib/gvc/gvrender__c.java index 42ccd534e..cbe645a6b 100644 --- a/src/gen/lib/gvc/gvrender__c.java +++ b/src/gen/lib/gvc/gvrender__c.java @@ -237,8 +237,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/label/index__c.java b/src/gen/lib/label/index__c.java index 2c510f32d..eda1fc21a 100644 --- a/src/gen/lib/label/index__c.java +++ b/src/gen/lib/label/index__c.java @@ -58,6 +58,7 @@ import static smetana.core.Macro.UNSUPPORTED; import h.ST_Branch_t; import h.ST_LeafList_t; import h.ST_Node_t___; +import h.ST_Node_t___or_object_t; import h.ST_RTree; import h.ST_Rect_t; import smetana.core.Memory; @@ -68,7 +69,7 @@ public class index__c { //3 1rfaqe5urty5uyp5xb2r0idce // LeafList_t *RTreeNewLeafList(Leaf_t * lp) -public static ST_LeafList_t RTreeNewLeafList(__ptr__ lp) { +public static ST_LeafList_t RTreeNewLeafList(ST_Branch_t lp) { ENTERING("1rfaqe5urty5uyp5xb2r0idce","RTreeNewLeafList"); try { ST_LeafList_t llp; @@ -94,14 +95,14 @@ LEAVING("1rfaqe5urty5uyp5xb2r0idce","RTreeNewLeafList"); //3 6pvstz7axi8a7saeqe3nrrmg5 // LeafList_t *RTreeLeafListAdd(LeafList_t * llp, Leaf_t * lp) -public static ST_LeafList_t RTreeLeafListAdd(ST_LeafList_t llp, __ptr__ lp) { +public static ST_LeafList_t RTreeLeafListAdd(ST_LeafList_t llp, ST_Branch_t lp) { ENTERING("6pvstz7axi8a7saeqe3nrrmg5","RTreeLeafListAdd"); try { ST_LeafList_t nlp; if (N(lp)) return llp; nlp = RTreeNewLeafList(lp); - nlp.setPtr("next", llp); + nlp.next = llp; return nlp; } finally { LEAVING("6pvstz7axi8a7saeqe3nrrmg5","RTreeLeafListAdd"); @@ -191,27 +192,27 @@ ENTERING("aa49m7d7qc06m8id896e60lkg","RTreeClose2"); try { int i; - if (n.getInt("level") > 0) { + if (n.level > 0) { for (i = 0; i < 64; i++) { - if (N(n.branch[i].getPtr("child"))) + if (N(n.branch[i].child)) continue; - if (N(RTreeClose2(rtp, (ST_Node_t___) n.branch[i].getPtr("child")))) { - Memory.free(n.branch[i].getPtr("child")); + if (N(RTreeClose2(rtp, (ST_Node_t___) n.branch[i].child))) { + Memory.free(n.branch[i].child); DisconBranch(n, i); rtp.setInt("EntryCount", rtp.EntryCount-1); if (rtp.StatFlag!=0) - rtp.setInt("ElimCount", rtp.getInt("ElimCount")+1); + rtp.setInt("ElimCount", rtp.ElimCount+1); } } } else { for (i = 0; i < 64; i++) { - if (N(n.branch[i].getPtr("child"))) + if (N(n.branch[i].child)) continue; // free(n->branch[i].child); DisconBranch(n, i); rtp.setInt("EntryCount", rtp.EntryCount-1); if (rtp.StatFlag!=0) - rtp.setInt("ElimCount", rtp.getInt("ElimCount")+1); + rtp.setInt("ElimCount", rtp.ElimCount+1); } //free(n); } @@ -226,8 +227,8 @@ LEAVING("aa49m7d7qc06m8id896e60lkg","RTreeClose2"); public static int RTreeClose(ST_RTree rtp) { ENTERING("aa59m7d7qc06m8id896e60lkg","RTreeClose"); try { - RTreeClose2(rtp, (ST_Node_t___) rtp.getPtr("root")); - Memory.free(rtp.getPtr("root")); + RTreeClose2(rtp, (ST_Node_t___) rtp.root); + Memory.free(rtp.root); Memory.free(rtp); return 0; } finally { @@ -255,22 +256,22 @@ try { rtp.setInt("SeTouchCount", rtp.SeTouchCount+1); - if (n.getInt("level") > 0) { /* this is an internal node in the tree */ + if (n.level > 0) { /* this is an internal node in the tree */ for (i = 0; i < 64; i++) - if (n.branch[i].getPtr("child")!=null && + if (n.branch[i].child!=null && Overlap(r, n.branch[i].rect)) { - ST_LeafList_t tlp = RTreeSearch(rtp, (ST_Node_t___) n.branch[i].getPtr("child"), r); + ST_LeafList_t tlp = RTreeSearch(rtp, (ST_Node_t___) n.branch[i].child, r); if (llp!=null) { ST_LeafList_t xlp = llp; while (xlp.next!=null) xlp = (ST_LeafList_t) xlp.next; - xlp.setPtr("next", tlp); + xlp.next = tlp; } else llp = tlp; } } else { /* this is a leaf node */ for (i = 0; i < 64; i++) { - if (n.branch[i].getPtr("child")!=null && Overlap(r, n.branch[i].rect)) { + if (n.branch[i].child!=null && Overlap(r, n.branch[i].rect)) { llp = RTreeLeafListAdd(llp, /*(Leaf_t *)*/ n.branch[i]); } } @@ -316,7 +317,7 @@ UNSUPPORTED("bzb1oqc35evr96528iv16glb0"); // rtp->ReInsertCount++; UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else UNSUPPORTED("3kxquse3qg2crme5dzybg9jxe"); // rtp->InsertCount++; } - if (N(rtp.getInt("Deleting"))) + if (N(rtp.Deleting)) rtp.setInt("RectCount", rtp.RectCount+1); if (RTreeInsert2(rtp, r, data, n[0], newnode, level)!=0) { /* root was split */ if (rtp.StatFlag!=0) { @@ -326,13 +327,13 @@ UNSUPPORTED("5c97f6vfxny0zz35l2bu4maox"); // else UNSUPPORTED("2u8wpa4w1q7rg14t07bny6p8i"); // rtp->InTouchCount++; } newroot = RTreeNewNode(rtp); /* grow a new root, make tree taller */ - rtp.setInt("NonLeafCount", rtp.getInt("NonLeafCount")+1); - newroot.setInt("level", n[0].getInt("level") + 1); + rtp.setInt("NonLeafCount", rtp.NonLeafCount+1); + newroot.setInt("level", n[0].level + 1); b.setStruct("rect", NodeCover(n[0])); - b.setPtr("child", n[0]); + b.child = n[0]; AddBranch(rtp, b, newroot, null); b.setStruct("rect", NodeCover(newnode[0])); - b.setPtr("child", newnode[0]); + b.child = newnode[0]; AddBranch(rtp, b, newroot, null); n[0] = newroot; // rtp->root = newroot; @@ -370,9 +371,9 @@ UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else UNSUPPORTED("1um729vqiy3529kbsrzyl9u3y"); // rtp->InTouchCount++; } /* Still above level for insertion, go down tree recursively */ - if (n.getInt("level") > level) { + if (n.level > level) { i = PickBranch(r, n); - if (N(RTreeInsert2(rtp, r, data, (ST_Node_t___) n.branch[i].getPtr("child"), n2, level))) { + if (N(RTreeInsert2(rtp, r, data, (ST_Node_t___) n.branch[i].child, n2, level))) { /* recurse: child was not split */ n.branch[i].setStruct("rect", CombineRect((ST_Rect_t)r, (ST_Rect_t) n.branch[i].rect)); @@ -384,10 +385,10 @@ UNSUPPORTED("50z4r9qcomgi4o7vvwq0v0xs"); // b.rect = NodeCover(n2); UNSUPPORTED("451qw2ioqybj69k9abzvqw4mk"); // rtp->EntryCount++; UNSUPPORTED("9uz11nbvh6yp6yq2axvo7e0fb"); // return AddBranch(rtp, &b, n, new); } - } else if (n.getInt("level") == level) { /* at level for insertion. */ + } else if (n.level == level) { /* at level for insertion. */ /*Add rect, split if necessary */ b.rect.___(r); - b.setPtr("child", /*(Node_t *)*/data); // THIS CAST IS A BIG ISSUE + b.child = /*(Node_t *)*/(ST_Node_t___or_object_t) data; // THIS CAST IS A BIG ISSUE // UNSUPPORTED("7w1b5nw2bj3zmo70m9bczwwov"); // b.child = (Node_t *) data; rtp.setInt("EntryCount", rtp.EntryCount+1); return AddBranch(rtp, b, n, new_); diff --git a/src/gen/lib/label/node__c.java b/src/gen/lib/label/node__c.java index f1845c999..4eaac1c67 100644 --- a/src/gen/lib/label/node__c.java +++ b/src/gen/lib/label/node__c.java @@ -65,7 +65,7 @@ public static ST_Node_t___ RTreeNewNode(ST_RTree rtp) { ENTERING("9uj7ni1m6q6drtoh56w82d6m4","RTreeNewNode"); try { ST_Node_t___ n; - rtp.setInt("NodeCount", rtp.getInt("NodeCount") + 1); + rtp.setInt("NodeCount", rtp.NodeCount + 1); n = new ST_Node_t___(); InitNode(n); return n; @@ -121,7 +121,7 @@ public static void InitBranch(ST_Branch_t b) { ENTERING("ruhxixxei7au9z1iaj0zggwo","InitBranch"); try { InitRect(b.rect); - b.setPtr("child", null); + b.child = null; } finally { LEAVING("ruhxixxei7au9z1iaj0zggwo","InitBranch"); } @@ -141,9 +141,9 @@ try { InitRect(r); flag = 1; for (i = 0; i < 64; i++) - if (n.branch[i].getPtr("child")!=null) { + if (n.branch[i].child!=null) { if (flag!=0) { - r.___(n.branch[i].getStruct("rect")); + r.___(n.branch[i].rect); flag = 0; } else r.___(CombineRect(r, (ST_Rect_t) n.branch[i].rect)); @@ -167,7 +167,7 @@ public static int PickBranch(ST_Rect_t r, ST_Node_t___ n) { int best=0; // assert(r && n); for (i = 0; i < 64; i++) { - if (n.branch[i].getPtr("child")!=null) { + if (n.branch[i].child!=null) { final ST_Rect_t rect = new ST_Rect_t(); rr = (ST_Rect_t) n.branch[i].rect; area = RectArea((ST_Rect_t) rr); @@ -205,7 +205,7 @@ try { // assert(n); if (n.count < 64) { /* split won't be necessary */ for (i = 0; i < 64; i++) { /* find empty branch */ - if (n.branch[i].getPtr("child") == null) { + if (n.branch[i].child == null) { n.branch[i].___(b.getStruct()); n.setInt("count", n.count+1); break; @@ -222,7 +222,7 @@ UNSUPPORTED("2u8wpa4w1q7rg14t07bny6p8i"); // rtp->InTouchCount++; } // assert(new); SplitNode(rtp, n, b, new_); - if (n.getInt("level") == 0) + if (n.level == 0) rtp.setInt("LeafCount", rtp.LeafCount+1); else UNSUPPORTED("6tkfiebspy7ecivrzb3l5y7jd"); // rtp->NonLeafCount++; diff --git a/src/gen/lib/label/rectangle__c.java b/src/gen/lib/label/rectangle__c.java index 3dba7e99e..5a6e5a87a 100644 --- a/src/gen/lib/label/rectangle__c.java +++ b/src/gen/lib/label/rectangle__c.java @@ -49,7 +49,6 @@ import static smetana.core.JUtilsDebug.LEAVING; import static smetana.core.Macro.N; import static smetana.core.Macro.UNSUPPORTED; import h.ST_Rect_t; -import smetana.core.__ptr__; public class rectangle__c { //1 9k44uhd5foylaeoekf3llonjq diff --git a/src/gen/lib/label/split_q__c.java b/src/gen/lib/label/split_q__c.java index b88ddba84..30f37cb8f 100644 --- a/src/gen/lib/label/split_q__c.java +++ b/src/gen/lib/label/split_q__c.java @@ -81,14 +81,14 @@ UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else UNSUPPORTED("2cjo6wz1rmxfm5k7u7rw5dqpj"); // rtp->InSplitCount++; } /* load all the branches into a buffer, initialize old node */ - level = n.getInt("level"); + level = n.level; GetBranches(rtp, n, b); /* find partition */ p = rtp.split.Partitions[0]; MethodZero(rtp); area = RectArea((ST_Rect_t)p.cover[0]) + RectArea((ST_Rect_t)p.cover[1]); /* record how good the split was for statistics */ - if (rtp.StatFlag!=0 && N(rtp.getInt("Deleting")) && area!=0) + if (rtp.StatFlag!=0 && N(rtp.Deleting) && area!=0) UNSUPPORTED("z7xk6s3hzi3qcoiq2exj9hpv"); // rtp->SplitMeritSum += (float) rtp->split.CoverSplitArea / area; /* put branches from buffer into 2 nodes according to chosen partition */ nn[0] = RTreeNewNode(rtp); @@ -119,7 +119,7 @@ try { } rtp.split.BranchBuf[64].___(b); /* calculate rect containing all in the set */ - rtp.split.getStruct("CoverSplit").___(rtp.split.BranchBuf[0].rect); + rtp.split.CoverSplit.___(rtp.split.BranchBuf[0].rect); for (i = 1; i < 64 + 1; i++) { rtp.split.setStruct("CoverSplit", CombineRect((ST_Rect_t)rtp.split.CoverSplit, @@ -147,9 +147,9 @@ try { PickSeeds(rtp); while (rtp.split.Partitions[0].count[0] + rtp.split.Partitions[0].count[1] < 64 + 1 && - rtp.split.Partitions[0].count[0] < 64 + 1 - rtp.getInt("MinFill") + rtp.split.Partitions[0].count[0] < 64 + 1 - rtp.MinFill && rtp.split.Partitions[0].count[1] < - 64 + 1 - rtp.getInt("MinFill")) { + 64 + 1 - rtp.MinFill) { biggestDiff = -1; for (i = 0; i < 64 + 1; i++) { if (N(rtp.split.Partitions[0].taken[i])) { diff --git a/src/gen/lib/label/xlabels__c.java b/src/gen/lib/label/xlabels__c.java index 2220bf777..8f48110b6 100644 --- a/src/gen/lib/label/xlabels__c.java +++ b/src/gen/lib/label/xlabels__c.java @@ -173,13 +173,13 @@ ST_XLabels_t xlp; xlp = new ST_XLabels_t(); /* used to load the rtree in hilbert space filling curve order */ xlp.setPtr("hdx", dtopen(Z.z().Hdisc, Z.z().Dtobag)); -if (N(xlp.getPtr("hdx"))) { +if (N(xlp.hdx)) { UNSUPPORTED("4t1y5iinm4310lkpvbal1spve"); // fprintf(stderr, "out of memory\n"); UNSUPPORTED("3m406diamp5s5kwcqtwo4pshf"); // goto bad; } /* for querying intersection candidates */ xlp.setPtr("spdx", RTreeOpen()); -if (N(xlp.getPtr("spdx"))) { +if (N(xlp.spdx)) { UNSUPPORTED("4t1y5iinm4310lkpvbal1spve"); // fprintf(stderr, "out of memory\n"); UNSUPPORTED("3m406diamp5s5kwcqtwo4pshf"); // goto bad; } @@ -211,7 +211,7 @@ LEAVING("88mbfm305igsr7cew5qx6yldp","xlnew"); public static void xlfree(ST_XLabels_t xlp) { ENTERING("apvhod2s1yjb8717rb7gie2kb","xlfree"); try { - RTreeClose((ST_RTree) xlp.getPtr("spdx")); + RTreeClose((ST_RTree) xlp.spdx); Memory.free(xlp); } finally { LEAVING("apvhod2s1yjb8717rb7gie2kb","xlfree"); @@ -284,7 +284,7 @@ LEAVING("9lkyvq87bawe3yon7bdwvcjzq","hd_hil_s_from_xy"); } } private static int hd_hil_s_from_xy_(ST_point p, int n) { - int i, x = p.getInt("x"), y = p.getInt("y"), xi, yi; + int i, x = p.x, y = p.y, xi, yi; int s; s = 0; /* Initialize. */ for (i = n - 1; i >= 0; i--) { @@ -344,10 +344,10 @@ try { ST_xlabel_t.Array xlp = (ST_xlabel_t.Array) objp.lbl; // assert(objp1->sz.x == 0 && objp1->sz.y == 0); if(N(xlp)) return false; - return objp1.getStruct("pos").getDouble("x") > xlp.getStruct("pos").getDouble("x") && - objp1.getStruct("pos").getDouble("x") < (xlp.getStruct("pos").getDouble("x") + xlp.getStruct("sz").getDouble("y")) && - objp1.getStruct("pos").getDouble("y") > xlp.getStruct("pos").getDouble("y") && - objp1.getStruct("pos").getDouble("y") < (xlp.getStruct("pos").getDouble("y") + xlp.getStruct("sz").getDouble("y")); + return objp1.pos.x > xlp.getStruct().pos.x && + objp1.pos.x < (xlp.getStruct().pos.x + xlp.getStruct().sz.y) && + objp1.pos.y > xlp.getStruct().pos.y && + objp1.pos.y < (xlp.getStruct().pos.y + xlp.getStruct().sz.y); // UNSUPPORTED("exdts7f2bpam5122kabq2b86c"); // return objp1->pos.x > xlp->pos.x && // UNSUPPORTED("99uxf5dqw5nzdymlzfj764uol"); // objp1->pos.x < (xlp->pos.x + xlp->sz.x) && // UNSUPPORTED("epx7s3oiw75fuioasz208w1k1"); // objp1->pos.y > xlp->pos.y && @@ -367,10 +367,10 @@ LEAVING("2g71cq6f8w5jbmbnn2x9y5qfq","lblenclosing"); public static void objp2rect(ST_object_t op, ST_Rect_t r) { ENTERING("dq1wkb4oxshdggv6cwtgas6m","objp2rect"); try { - r.boundary[0]=((int)op.getStruct("pos").getDouble("x")); - r.boundary[1]=((int)op.getStruct("pos").getDouble("y")); - r.boundary[2]=((int)(op.getStruct("pos").getDouble("x")+op.getStruct("sz").getDouble("x"))); - r.boundary[3]=((int)(op.getStruct("pos").getDouble("y")+op.getStruct("sz").getDouble("y"))); + r.boundary[0]=((int)op.pos.x); + r.boundary[1]=((int)op.pos.y); + r.boundary[2]=((int)(op.pos.x+op.sz.x)); + r.boundary[3]=((int)(op.pos.y+op.sz.y)); } finally { LEAVING("dq1wkb4oxshdggv6cwtgas6m","objp2rect"); } @@ -385,10 +385,10 @@ public static void objplp2rect(ST_object_t objp, ST_Rect_t r) { ENTERING("71b5ttp3xs7lo9fqgb7ypyqgx","objplp2rect"); try { ST_xlabel_t.Array lp = (ST_xlabel_t.Array) objp.lbl; - r.boundary[0]=((int)lp.getStruct("pos").getDouble("x")); - r.boundary[1]=((int)lp.getStruct("pos").getDouble("y")); - r.boundary[2]=((int)(lp.getStruct("pos").getDouble("x")+lp.getStruct("sz").getDouble("x"))); - r.boundary[3]=((int)(lp.getStruct("pos").getDouble("y")+lp.getStruct("sz").getDouble("y"))); + r.boundary[0]=((int)lp.getStruct().pos.x); + r.boundary[1]=((int)lp.getStruct().pos.y); + r.boundary[2]=((int)(lp.getStruct().pos.x+lp.getStruct().sz.x)); + r.boundary[3]=((int)(lp.getStruct().pos.y+lp.getStruct().sz.y)); } finally { LEAVING("71b5ttp3xs7lo9fqgb7ypyqgx","objplp2rect"); } @@ -407,12 +407,12 @@ try { p.setDouble("x", 0); p.setDouble("y", 0); if (objp.lbl!=null) - p.___(objp.lbl.getStruct("sz")); - rect.boundary[0]=((int) Math.floor(objp.getPtr("pos").getDouble("x") - p.getDouble("x"))); - rect.boundary[1]=((int) Math.floor(objp.getPtr("pos").getDouble("y") - p.getDouble("y"))); - rect.boundary[2]=((int) Math.ceil(objp.getPtr("pos").getDouble("x") + objp.getPtr("sz").getDouble("x") + p.getDouble("x"))); + p.___(objp.lbl.getStruct().sz); + rect.boundary[0]=((int) Math.floor(objp.pos.x - p.x)); + rect.boundary[1]=((int) Math.floor(objp.pos.y - p.y)); + rect.boundary[2]=((int) Math.ceil(objp.pos.x + objp.sz.x + p.x)); // assert(rect.boundary[2] < INT_MAX); - rect.boundary[3]=((int) Math.ceil(objp.getPtr("pos").getDouble("y") + objp.getPtr("sz").getDouble("y") + p.getDouble("y"))); + rect.boundary[3]=((int) Math.ceil(objp.pos.y + objp.sz.y + p.y)); // assert(rect.boundary[3] < INT_MAX); return rect; } finally { @@ -431,7 +431,7 @@ try { int i = -1; ST_xlabel_t.Array lp = (ST_xlabel_t.Array) op.lbl, clp = (ST_xlabel_t.Array) cp.lbl; assert(lp != clp); - if (lp.getInt("set") == 0 || clp.getInt("set") == 0) + if (lp.getStruct().set == 0 || clp.getStruct().set == 0) return i; UNSUPPORTED("bofpvwtmumoe1ckgnlgbwg8bt"); // if ((op->pos.x == 0.0 && op->pos.y == 0.0) || UNSUPPORTED("f039op8rn0jopi9r8kora4cwz"); // (cp->pos.x == 0.0 && cp->pos.y == 0.0)) @@ -492,10 +492,10 @@ try { if (maxa > 0.0) return maxa; /*replace overlapping label/object pair */ - intrsx[i] = (ST_object_t) cp.getStruct(); + intrsx[i] = cp; return a; } - intrsx[i] = (ST_object_t) cp.getPtr(); + intrsx[i] = cp; return a; } finally { LEAVING("52awwxu810dg9a2pjq45aomam","recordointrsx"); @@ -531,10 +531,10 @@ try { if (maxa > 0.0) return maxa; /*replace overlapping label/object pair */ - intrsx[i] = (ST_object_t) cp.getStruct(); + intrsx[i] = cp; return a; } - intrsx[i] = (ST_object_t) cp.getStruct(); + intrsx[i] = cp; return a; } finally { LEAVING("2umrncgkunxoyeuc8i9hd5pwa","recordlintrsx"); @@ -564,21 +564,24 @@ private static ST_BestPos_t xlintersections_(ST_XLabels_t xlp, ST_object_t objp, // assert(objp->lbl); bp.setInt("n", 0); bp.setDouble("area", 0.0); - bp.setStruct("pos", objp.lbl.getStruct("pos")); - for(i=0; i 0 && xlp.getPtr("objs").plus(i).getStruct("sz").getDouble("y") > 0) continue; - if(lblenclosing(objp, (ST_object_t) xlp.getPtr("objs").plus(i).getStruct())) { - bp.setInt("n", bp.getInt("n")+1); + bp.setStruct("pos", objp.lbl.getStruct().pos); + for(i=0; i 0 && xlp.objs.get(i).sz.y > 0) continue; + if(lblenclosing(objp, (ST_object_t) xlp.objs.plus(i).getStruct())) { + bp.setInt("n", bp.n+1); } } objplp2rect((ST_object_t) objp.getStruct(), rect); - llp = RTreeSearch((ST_RTree)xlp.getPtr("spdx"), (ST_Node_t___)xlp.getPtr("spdx").getPtr("root"), rect); + llp = RTreeSearch((ST_RTree)xlp.spdx, (ST_Node_t___)xlp.spdx.root, rect); if (N(llp)) return bp; for (ilp = llp; ilp!=null; ilp = (ST_LeafList_t) ilp.next) { double a, ra; - ST_object_t cp = (ST_object_t) ilp.getPtr("leaf").getPtr("data").getPtr(); + // WARNING FOR TRANSLATION + // In the C code, "data" was used. However ST_Branch_t is very close to ST_Leaf_t + // So in Java version, ST_Leaf_t has been removed and ST_Branch_t is used instead + ST_object_t cp = (ST_object_t) ilp.leaf.child; if (EQ(cp, objp)) continue; /*label-object intersect */ @@ -586,18 +589,18 @@ private static ST_BestPos_t xlintersections_(ST_XLabels_t xlp, ST_object_t objp, a = aabbaabb(rect, srect); if (a > 0.0) { ra = recordointrsx(xlp, objp, cp, rect, a, intrsx); - bp.setInt("n", bp.getInt("n")+1); - bp.setDouble("area", bp.getDouble("area")+ra); + bp.setInt("n", bp.n+1); + bp.setDouble("area", bp.area+ra); } /*label-label intersect */ - if (N(cp.lbl) || N(cp.lbl.getInt("set"))) + if (N(cp.lbl) || N(cp.lbl.getStruct().set)) continue; objplp2rect((ST_object_t) cp.getStruct(), srect); a = aabbaabb(rect, srect); if (a > 0.0) { ra = recordlintrsx(xlp, objp, cp, rect, a, intrsx); - bp.setInt("n", bp.getInt("n")+1); - bp.setDouble("area", bp.getDouble("area")+ra); + bp.setInt("n", bp.n+1); + bp.setDouble("area", bp.area+ra); } } RTreeLeafListFree(llp); @@ -619,72 +622,72 @@ LEAVING("8rxvucqsqnqej6h8p1osfnk4b","xladjust"); } private static ST_BestPos_t xladjust_(ST_XLabels_t xlp, ST_object_t objp) { ST_xlabel_t.Array lp = (ST_xlabel_t.Array) objp.lbl; // ST_xlabel_t - double xincr = ((2 * lp.getStruct("sz").getDouble("x") + objp.getStruct("sz").getDouble("x"))) / 8; - double yincr = ((2 * lp.getStruct("sz").getDouble("y") + objp.getStruct("sz").getDouble("y"))) / 2; + double xincr = ((2 * lp.getStruct().sz.x + objp.sz.x)) / 8; + double yincr = ((2 * lp.getStruct().sz.y + objp.sz.y)) / 2; ST_object_t intrsx[] = new ST_object_t[9]; final ST_BestPos_t bp = new ST_BestPos_t(); final ST_BestPos_t nbp = new ST_BestPos_t(); // assert(objp->lbl); // memset(intrsx, 0, sizeof(intrsx)); /*x left */ - lp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x") - lp.getStruct("sz").getDouble("x")); + lp.getStruct().pos.setDouble("x", objp.pos.x - lp.getStruct().sz.x); /*top */ - lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") + objp.getStruct("sz").getDouble("y")); + lp.getStruct().pos.setDouble("y", objp.pos.y + objp.sz.y); bp.___(xlintersections(xlp, objp, intrsx)); - if (bp.getInt("n") == 0) + if (bp.n == 0) return bp; /*mid */ - lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y")); + lp.getStruct().pos.setDouble("y", objp.pos.y); nbp.___(xlintersections(xlp, objp, intrsx)); - if (nbp.getInt("n") == 0) + if (nbp.n == 0) return nbp; - if (nbp.getDouble("area") < bp.getDouble("area")) + if (nbp.area < bp.area) bp.___(nbp); /*bottom */ - lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") - lp.getStruct("sz").getDouble("y")); + lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y); nbp.___(xlintersections(xlp, objp, intrsx)); - if (nbp.getInt("n") == 0) + if (nbp.n == 0) return nbp; - if (nbp.getDouble("area") < bp.getDouble("area")) + if (nbp.area < bp.area) bp.___(nbp); /*x mid */ - lp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x")); + lp.getStruct().pos.setDouble("x", objp.pos.x); /*top */ - lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") + objp.getStruct("sz").getDouble("y")); + lp.getStruct().pos.setDouble("y", objp.pos.y + objp.sz.y); nbp.___(xlintersections(xlp, objp, intrsx)); - if (nbp.getInt("n") == 0) + if (nbp.n == 0) return nbp; - if (nbp.getDouble("area") < bp.getDouble("area")) + if (nbp.area < bp.area) bp.___(nbp); /*bottom */ - lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") - lp.getStruct("sz").getDouble("y")); + lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y); nbp.___(xlintersections(xlp, objp, intrsx)); - if (nbp.getInt("n") == 0) + if (nbp.n == 0) return nbp; - if (nbp.getDouble("area") < bp.getDouble("area")) + if (nbp.area < bp.area) bp.___(nbp); /*x right */ - lp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x") + objp.getStruct("sz").getDouble("x")); + lp.getStruct().pos.setDouble("x", objp.pos.x + objp.sz.x); /*top */ - lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") + objp.getStruct("sz").getDouble("y")); + lp.getStruct().pos.setDouble("y", objp.pos.y + objp.sz.y); nbp.___(xlintersections(xlp, objp, intrsx)); -if (nbp.getInt("n") == 0) +if (nbp.n == 0) return nbp; -if (nbp.getDouble("area") < bp.getDouble("area")) +if (nbp.area < bp.area) bp.___(nbp); /*mid */ - lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y")); + lp.getStruct().pos.setDouble("y", objp.pos.y); nbp.___(xlintersections(xlp, objp, intrsx)); -if (nbp.getInt("n") == 0) +if (nbp.n == 0) return nbp; -if (nbp.getDouble("area") < bp.getDouble("area")) +if (nbp.area < bp.area) bp.___(nbp); /*bottom */ - lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") - lp.getStruct("sz").getDouble("y")); + lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y); nbp.___(xlintersections(xlp, objp, intrsx)); -if (nbp.getInt("n") == 0) +if (nbp.n == 0) return nbp; -if (nbp.getDouble("area") < bp.getDouble("area")) +if (nbp.area < bp.area) bp.___(nbp); /*sliding from top left */ if (intrsx[6]!=null || intrsx[7]!=null || intrsx[8]!=null || intrsx[3]!=null || intrsx[0]!=null) { /* have to move */ @@ -716,19 +719,19 @@ UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // } UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // } } /*sliding from bottom right */ - lp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x") + objp.getStruct("sz").getDouble("x")); - lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") - lp.getStruct("sz").getDouble("y")); + lp.getStruct().pos.setDouble("x", objp.pos.x + objp.sz.x); + lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y); if (intrsx[2]!=null || intrsx[1]!=null || intrsx[0]!=null || intrsx[5]!=null || intrsx[8]!=null) { /* have to move */ if (N(intrsx[1]) && N(intrsx[0])) { /* some room left? */ /* slide along lower edge */ - for (lp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x") + objp.getStruct("sz").getDouble("x")), - lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") - lp.getStruct("sz").getDouble("y")); - lp.getStruct("pos").getDouble("x") >= (objp.getStruct("pos").getDouble("x") - lp.getStruct("sz").getDouble("x")); - lp.getStruct("pos").setDouble("x", lp.getStruct("pos").getDouble("x") - xincr)) { + for (lp.getStruct().pos.setDouble("x", objp.pos.x + objp.sz.x), + lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y); + lp.getStruct().pos.x >= (objp.pos.x - lp.getStruct().sz.x); + lp.getStruct().pos.setDouble("x", lp.getStruct().pos.x - xincr)) { nbp.___(xlintersections(xlp, objp, intrsx)); - if (nbp.getInt("n") == 0) + if (nbp.n == 0) return nbp; - if (nbp.getDouble("area") < bp.getDouble("area")) + if (nbp.area < bp.area) bp.___(nbp); } } @@ -759,19 +762,19 @@ ENTERING("e29g2hwlogx0zchsnvi464c7t","xlhdxload"); try { int i; int order = xlhorder(xlp); - for (i = 0; i < xlp.getInt("n_objs"); i++) { + for (i = 0; i < xlp.n_objs; i++) { ST_HDict_t hp; final ST_point pi = new ST_point(); hp = new ST_HDict_t(); - hp.getStruct("d").setPtr("data", (__ptr__) xlp.getPtr("objs").plus(i).getStruct()); - hp.getStruct("d").setStruct("rect", objplpmks(xlp, (ST_object_t) xlp.getPtr("objs").plus(i).getStruct())); + hp.d.child = xlp.objs.get(i); + hp.d.setStruct("rect", objplpmks(xlp, (ST_object_t) xlp.objs.plus(i).getStruct())); /* center of the labeling area */ pi.setInt("x", hp.d.rect.boundary[0] + (hp.d.rect.boundary[2] - hp.d.rect.boundary[0]) / 2); pi.setInt("y", hp.d.rect.boundary[1] + (hp.d.rect.boundary[3] - hp.d.rect.boundary[1]) / 2); hp.setInt("key", hd_hil_s_from_xy(pi, order)); - if (N(xlp.getPtr("hdx").call("searchf", xlp.getPtr("hdx"), hp, 0000001))) + if (N(xlp.hdx.searchf.exe(xlp.hdx, hp, 0000001))) return -1; } return 0; @@ -816,16 +819,16 @@ public static int xlspdxload(ST_XLabels_t xlp) { ENTERING("3wrxwwd3y5ts0ekr32o8vhuvv","xlspdxload"); try { ST_HDict_t op=null; - for (op = (ST_HDict_t) xlp.getPtr("hdx").call("searchf", xlp.getPtr("hdx"), null, 0000200); op!=null; - op = (ST_HDict_t) xlp.getPtr("hdx").call("searchf", xlp.getPtr("hdx"), op, 0000010)) { + for (op = (ST_HDict_t) xlp.hdx.searchf.exe(xlp.hdx, null, 0000200); op!=null; + op = (ST_HDict_t) xlp.hdx.searchf.exe(xlp.hdx, op, 0000010)) { /* tree rectangle data node lvl */ // RTreeInsert(xlp->spdx, &op->d.rect, op->d.data, &xlp->spdx->root, 0); // WARNING ARRAY - final ST_Node_t___[] tmp = new ST_Node_t___[] {(ST_Node_t___) xlp.getPtr("spdx").getPtr("root")}; - RTreeInsert((ST_RTree) xlp.getPtr("spdx"), (ST_Rect_t)op.d.rect, - op.d.data, + final ST_Node_t___[] tmp = new ST_Node_t___[] {(ST_Node_t___) xlp.spdx.root}; + RTreeInsert((ST_RTree) xlp.spdx, (ST_Rect_t)op.d.rect, + op.d.child, tmp, 0); - xlp.getPtr("spdx").setPtr("root", tmp[0]); + xlp.spdx.setPtr("root", tmp[0]); } return 0; } finally { @@ -847,7 +850,7 @@ try { if ((r = xlspdxload(xlp)) < 0) return r; xlhdxunload(xlp); - return dtclose((ST_dt_s) xlp.getPtr("hdx")); + return dtclose((ST_dt_s) xlp.hdx); } finally { LEAVING("6d3fqrllm55toeo3wscwvv4ty","xlinitialize"); } @@ -887,15 +890,15 @@ ST_XLabels_t xlp = xlnew(objs, n_objs, lbls, n_lbls, params); continue; xladjust(xlp, (ST_object_t) objs.get(i).getStruct()); bp.___(xladjust(xlp, (ST_object_t) objs.get(i).getStruct())); - if (bp.getInt("n") == 0) { + if (bp.n == 0) { + objs.get(i).lbl.setInt("set", 1); + } else if(bp.area == 0) { + objs.get(i).lbl.getStruct().pos.setDouble("x", bp.pos.x); + objs.get(i).lbl.getStruct().pos.setDouble("y", bp.pos.y); objs.get(i).lbl.setInt("set", 1); - } else if(bp.getDouble("area") == 0) { -UNSUPPORTED("djsgfzak14js9ukvgmoqnkm8v"); // objs[i].lbl->pos.x = bp.pos.x; -UNSUPPORTED("5s2aq4djc0l3xyilkowd7ri1r"); // objs[i].lbl->pos.y = bp.pos.y; -UNSUPPORTED("1wsz4ptoxskyulgu7czf059sf"); // objs[i].lbl->set = 1; } else if (params.force) { - objs.get(i).lbl.getStruct("pos").setDouble("x", bp.getStruct("pos").getDouble("x")); - objs.get(i).lbl.getStruct("pos").setDouble("y", bp.getStruct("pos").getDouble("y")); + objs.get(i).lbl.getStruct().pos.setDouble("x", bp.pos.x); + objs.get(i).lbl.getStruct().pos.setDouble("y", bp.pos.y); objs.get(i).lbl.setInt("set", 1); } else { r = 1; diff --git a/src/gen/lib/ortho/ortho__c.java b/src/gen/lib/ortho/ortho__c.java index 0de76a8e7..02fa8896f 100644 --- a/src/gen/lib/ortho/ortho__c.java +++ b/src/gen/lib/ortho/ortho__c.java @@ -242,8 +242,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/pack/ccomps__c.java b/src/gen/lib/pack/ccomps__c.java index e46a1b42b..5a283ad55 100644 --- a/src/gen/lib/pack/ccomps__c.java +++ b/src/gen/lib/pack/ccomps__c.java @@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/pack/pack__c.java b/src/gen/lib/pack/pack__c.java index c3092b259..6a0702a47 100644 --- a/src/gen/lib/pack/pack__c.java +++ b/src/gen/lib/pack/pack__c.java @@ -377,8 +377,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); @@ -1934,7 +1934,7 @@ UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // } //fprintf (stderr, " size %d\n", pinfo->sz); //fprintf (stderr, " flags %d\n", pinfo->flags); //} - return pinfo.getInt("mode"); + return pinfo.mode; } finally { LEAVING("dyb1n3lhbi0wnr9kvmu6onux9","parsePackModeInfo"); } @@ -2009,7 +2009,7 @@ try { pinfo.setInt("doSplines", 0); pinfo.setInt("fixed", 0); getPackModeInfo(g, dflt, pinfo); - return pinfo.getInt("mode"); + return pinfo.mode; } finally { LEAVING("ce4a70w8ddkj4l9efi74h61s6","getPackInfo"); } diff --git a/src/gen/lib/pack/ptest__c.java b/src/gen/lib/pack/ptest__c.java index aafa8b42f..e1094200f 100644 --- a/src/gen/lib/pack/ptest__c.java +++ b/src/gen/lib/pack/ptest__c.java @@ -372,8 +372,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) { ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); try { final ST_pointf r = new ST_pointf(); - r.setDouble("x", p.getDouble("x") + q.getDouble("x")); - r.setDouble("y", p.getDouble("y") + q.getDouble("y")); + r.setDouble("x", p.x + q.x); + r.setDouble("y", p.y + q.y); return r; } finally { LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); diff --git a/src/gen/lib/pathplan/route__c.java b/src/gen/lib/pathplan/route__c.java index 3b6af8fb9..aa390f58b 100644 --- a/src/gen/lib/pathplan/route__c.java +++ b/src/gen/lib/pathplan/route__c.java @@ -52,6 +52,7 @@ import static smetana.core.JUtilsDebug.LEAVING; import static smetana.core.Macro.DISTSQ; import static smetana.core.Macro.N; import static smetana.core.Macro.UNSUPPORTED; +import h.ST_Pedge_t; import h.ST_Ppoly_t; import h.ST_pointf; import h.ST_tna_t; @@ -85,14 +86,14 @@ private static jmp_buf jbuf = new jmp_buf(); //3 9stmrdqlmufyk2wutp3totr5j // int Proutespline(Pedge_t * edges, int edgen, Ppolyline_t input, Ppoint_t * evs, Ppolyline_t * output) -public static int Proutespline(__ptr__ edges, int edgen, ST_Ppoly_t input, __ptr__ evs, ST_Ppoly_t output) { +public static int Proutespline(ST_Pedge_t.Array edges, int edgen, ST_Ppoly_t input, __ptr__ evs, ST_Ppoly_t output) { // WARNING!! STRUCT return Proutespline_w_(edges, edgen, (ST_Ppoly_t) input.copy(), evs, output); } -private static int Proutespline_w_(__ptr__ edges, int edgen, final ST_Ppoly_t input, __ptr__ evs, ST_Ppoly_t output) { +private static int Proutespline_w_(ST_Pedge_t.Array edges, int edgen, final ST_Ppoly_t input, __ptr__ evs, ST_Ppoly_t output) { ENTERING("9stmrdqlmufyk2wutp3totr5j","Proutespline"); try { - __ptr__ inps; + ST_pointf.Array inps; int inpn; /* unpack into previous format rather than modify legacy code */ inps = input.ps; @@ -123,11 +124,11 @@ LEAVING("9stmrdqlmufyk2wutp3totr5j","Proutespline"); // static int reallyroutespline(Pedge_t * edges, int edgen, Ppoint_t * inps, int inpn, Ppoint_t ev0, Ppoint_t ev1) //private static __ptr__ tnas; //private static int tnan; -public static int reallyroutespline(__ptr__ edges, int edgen, __ptr__ inps, int inpn, final ST_pointf ev0, final ST_pointf ev1) { +public static int reallyroutespline(ST_Pedge_t.Array edges, int edgen, ST_pointf.Array inps, int inpn, final ST_pointf ev0, final ST_pointf ev1) { // WARNING!! STRUCT return reallyroutespline_w_(edges, edgen, inps, inpn, ev0.copy(), ev1.copy()); } -private static int reallyroutespline_w_(__ptr__ edges, int edgen, __ptr__ inps, int inpn, final ST_pointf ev0, final ST_pointf ev1) { +private static int reallyroutespline_w_(ST_Pedge_t.Array edges, int edgen, ST_pointf.Array inps, int inpn, final ST_pointf ev0, final ST_pointf ev1) { ENTERING("13dxqzbgtpl4ubnnvw6ehzzi9","reallyroutespline"); try { final ST_pointf p1 = new ST_pointf(), p2 = new ST_pointf(), cp1 = new ST_pointf(), cp2 = new ST_pointf(), p = new ST_pointf(); @@ -146,12 +147,12 @@ try { } Z.z().tnas.plus(0).getStruct().setDouble("t", 0); for (i = 1; i < inpn; i++) - Z.z().tnas.plus(i).getStruct().setDouble("t", Z.z().tnas.plus(i-1).getStruct().getDouble("t") + dist((ST_pointf)inps.plus(i).getStruct(), (ST_pointf)inps.plus(i-1).getStruct())); + Z.z().tnas.plus(i).getStruct().setDouble("t", Z.z().tnas.plus(i-1).getStruct().t + dist((ST_pointf)inps.plus(i).getStruct(), (ST_pointf)inps.plus(i-1).getStruct())); for (i = 1; i < inpn; i++) - Z.z().tnas.plus(i).getStruct().setDouble("t", Z.z().tnas.plus(i).getStruct().getDouble("t") / Z.z().tnas.plus(inpn - 1).getStruct().getDouble("t")); + Z.z().tnas.plus(i).getStruct().setDouble("t", Z.z().tnas.plus(i).getStruct().t / Z.z().tnas.plus(inpn - 1).getStruct().t); for (i = 0; i < inpn; i++) { - ((ST_tna_t)Z.z().tnas.plus(i).getStruct()).a[0].____(scale(ev0, B1(Z.z().tnas.plus(i).getStruct().getDouble("t")))); - ((ST_tna_t)Z.z().tnas.plus(i).getStruct()).a[1].____(scale(ev1, B2(Z.z().tnas.plus(i).getStruct().getDouble("t")))); + ((ST_tna_t)Z.z().tnas.plus(i).getStruct()).a[0].____(scale(ev0, B1(Z.z().tnas.plus(i).getStruct().t))); + ((ST_tna_t)Z.z().tnas.plus(i).getStruct()).a[1].____(scale(ev1, B2(Z.z().tnas.plus(i).getStruct().t))); } if (mkspline(inps, inpn, Z.z().tnas, ev0, ev1, p1, v1, p2, v2) == -1) return -1; @@ -160,9 +161,9 @@ try { cp1.___(add(p1, scale(v1, 1 / 3.0))); cp2.___(sub(p2, scale(v2, 1 / 3.0))); for (maxd = -1, maxi = -1, i = 1; i < inpn - 1; i++) { - t = Z.z().tnas.plus(i).getDouble("t"); - p.setDouble("x", B0(t) * p1.getDouble("x") + B1(t) * cp1.getDouble("x") + B2(t) * cp2.getDouble("x") + B3(t) * p2.getDouble("x")); - p.setDouble("y", B0(t) * p1.getDouble("y") + B1(t) * cp1.getDouble("y") + B2(t) * cp2.getDouble("y") + B3(t) * p2.getDouble("y")); + t = Z.z().tnas.get(i).t; + p.setDouble("x", B0(t) * p1.x + B1(t) * cp1.x + B2(t) * cp2.x + B3(t) * p2.x); + p.setDouble("y", B0(t) * p1.y + B1(t) * cp1.y + B2(t) * cp2.y + B3(t) * p2.y); if ((d = dist(p, (ST_pointf) inps.plus(i).getStruct())) > maxd) {maxd = d; maxi = i;} } @@ -184,11 +185,11 @@ LEAVING("13dxqzbgtpl4ubnnvw6ehzzi9","reallyroutespline"); //3 29sok6jkfyobf83q130snkhmh // static int mkspline(Ppoint_t * inps, int inpn, tna_t * tnas, Ppoint_t ev0, Ppoint_t ev1, Ppoint_t * sp0, Ppoint_t * sv0, Ppoint_t * sp1, Ppoint_t * sv1) -public static int mkspline(__ptr__ inps, int inpn, __ptr__ tnas, final ST_pointf ev0, final ST_pointf ev1, __ptr__ sp0, __ptr__ sv0, __ptr__ sp1, __ptr__ sv1) { +public static int mkspline(__ptr__ inps, int inpn, ST_tna_t.Array tnas, final ST_pointf ev0, final ST_pointf ev1, __ptr__ sp0, __ptr__ sv0, __ptr__ sp1, __ptr__ sv1) { // WARNING!! STRUCT return mkspline_w_(inps, inpn, tnas, ev0.copy(), ev1.copy(), sp0, sv0, sp1, sv1); } -private static int mkspline_w_(__ptr__ inps, int inpn, __ptr__ tnas, final ST_pointf ev0, final ST_pointf ev1, __ptr__ sp0, __ptr__ sv0, __ptr__ sp1, __ptr__ sv1) { +private static int mkspline_w_(__ptr__ inps, int inpn, ST_tna_t.Array tnas, final ST_pointf ev0, final ST_pointf ev1, __ptr__ sp0, __ptr__ sv0, __ptr__ sp1, __ptr__ sv1) { ENTERING("29sok6jkfyobf83q130snkhmh","mkspline"); try { final ST_pointf tmp = new ST_pointf(); @@ -205,8 +206,8 @@ try { c[0][1] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[0], ((ST_tna_t)tnas.plus(i).getStruct()).a[1]); c[1][0] = c[0][1]; c[1][1] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[1], ((ST_tna_t)tnas.plus(i).getStruct()).a[1]); - tmp.___(sub((ST_pointf) inps.plus(i).getStruct(), add(scale((ST_pointf) inps.plus(0).getStruct(), B01(tnas.plus(i).getStruct().getDouble("t"))), - scale((ST_pointf) inps.plus(inpn - 1).getStruct(), B23(tnas.plus(i).getStruct().getDouble("t")))))); + tmp.___(sub((ST_pointf) inps.plus(i).getStruct(), add(scale((ST_pointf) inps.plus(0).getStruct(), B01(tnas.plus(i).getStruct().t)), + scale((ST_pointf) inps.plus(inpn - 1).getStruct(), B23(tnas.plus(i).getStruct().t))))); x[0] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[0], tmp); x[1] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[1], tmp); } @@ -237,7 +238,7 @@ LEAVING("29sok6jkfyobf83q130snkhmh","mkspline"); //3 ea6jsc0rwfyjtmmuxax6r5ngk // static double dist_n(Ppoint_t * p, int n) -public static double dist_n(__ptr__ p, int n) { +public static double dist_n(ST_pointf.Array p, int n) { ENTERING("ea6jsc0rwfyjtmmuxax6r5ngk","dist_n"); try { int i; @@ -245,8 +246,8 @@ try { rv = 0.0; for (i = 1; i < n; i++) { rv += - sqrt((p.plus(i).getStruct().getDouble("x") - p.plus(i - 1).getStruct().getDouble("x")) * (p.plus(i).getStruct().getDouble("x") - p.plus(i - 1).getStruct().getDouble("x"))+ - (p.plus(i).getStruct().getDouble("y") - p.plus(i - 1).getStruct().getDouble("y")) * (p.plus(i).getStruct().getDouble("y") - p.plus(i - 1).getStruct().getDouble("y"))); + sqrt((p.plus(i).getStruct().x - p.plus(i - 1).getStruct().x) * (p.plus(i).getStruct().x - p.plus(i - 1).getStruct().x)+ + (p.plus(i).getStruct().y - p.plus(i - 1).getStruct().y) * (p.plus(i).getStruct().y - p.plus(i - 1).getStruct().y)); } return rv; } finally { @@ -259,11 +260,11 @@ LEAVING("ea6jsc0rwfyjtmmuxax6r5ngk","dist_n"); //3 987ednrgu5qo9dzhpiox47mhb // static int splinefits(Pedge_t * edges, int edgen, Ppoint_t pa, Pvector_t va, Ppoint_t pb, Pvector_t vb, Ppoint_t * inps, int inpn) -public static int splinefits(__ptr__ edges, int edgen, final ST_pointf pa, final ST_pointf va, final ST_pointf pb, final ST_pointf vb, __ptr__ inps, int inpn) { +public static int splinefits(ST_Pedge_t.Array edges, int edgen, final ST_pointf pa, final ST_pointf va, final ST_pointf pb, final ST_pointf vb, ST_pointf.Array inps, int inpn) { // WARNING!! STRUCT return splinefits_w_(edges, edgen, pa.copy(), va.copy(), pb.copy(), vb.copy(), inps, inpn); } -private static int splinefits_w_(__ptr__ edges, int edgen, final ST_pointf pa, final ST_pointf va, final ST_pointf pb, final ST_pointf vb, __ptr__ inps, int inpn) { +private static int splinefits_w_(ST_Pedge_t.Array edges, int edgen, final ST_pointf pa, final ST_pointf va, final ST_pointf pb, final ST_pointf vb, ST_pointf.Array inps, int inpn) { ENTERING("987ednrgu5qo9dzhpiox47mhb","splinefits"); try { final ST_pointf.Array sps = new ST_pointf.Array( 4); @@ -274,14 +275,14 @@ try { forceflag = (inpn == 2 ? 1 : 0); a = b = 4; for (;;) { - sps.plus(0).getStruct().setDouble("x", pa.getDouble("x")); - sps.plus(0).getStruct().setDouble("y", pa.getDouble("y")); - sps.plus(1).getStruct().setDouble("x", pa.getDouble("x") + a * va.getDouble("x") / 3.0); - sps.plus(1).getStruct().setDouble("y", pa.getDouble("y") + a * va.getDouble("y") / 3.0); - sps.plus(2).getStruct().setDouble("x", pb.getDouble("x") - b * vb.getDouble("x") / 3.0); - sps.plus(2).getStruct().setDouble("y", pb.getDouble("y") - b * vb.getDouble("y") / 3.0); - sps.plus(3).getStruct().setDouble("x", pb.getDouble("x")); - sps.plus(3).getStruct().setDouble("y", pb.getDouble("y")); + sps.plus(0).getStruct().setDouble("x", pa.x); + sps.plus(0).getStruct().setDouble("y", pa.y); + sps.plus(1).getStruct().setDouble("x", pa.x + a * va.x / 3.0); + sps.plus(1).getStruct().setDouble("y", pa.y + a * va.y / 3.0); + sps.plus(2).getStruct().setDouble("x", pb.x - b * vb.x / 3.0); + sps.plus(2).getStruct().setDouble("y", pb.y - b * vb.y / 3.0); + sps.plus(3).getStruct().setDouble("x", pb.x); + sps.plus(3).getStruct().setDouble("y", pb.y); /* shortcuts (paths shorter than the shortest path) not allowed - * they must be outside the constraint polygon. this can happen * if the candidate spline intersects the constraint polygon exactly @@ -295,8 +296,8 @@ try { if (splineisinside(edges, edgen, sps)) { growops(Z.z().opl + 4); for (pi = 1; pi < 4; pi++) { - Z.z().ops_route.plus(Z.z().opl).setDouble("x", sps.plus(pi).getStruct().getDouble("x")); - Z.z().ops_route.plus(Z.z().opl).setDouble("y", sps.plus(pi).getStruct().getDouble("y")); + Z.z().ops_route.plus(Z.z().opl).setDouble("x", sps.plus(pi).getStruct().x); + Z.z().ops_route.plus(Z.z().opl).setDouble("y", sps.plus(pi).getStruct().y); Z.z().opl++; } return 1; @@ -306,8 +307,8 @@ try { growops(Z.z().opl + 4); for (pi = 1; pi < 4; pi++) { - Z.z().ops_route.plus(Z.z().opl).setDouble("x", sps.plus(pi).getStruct().getDouble("x")); - Z.z().ops_route.plus(Z.z().opl).setDouble("y", sps.plus(pi).getStruct().getDouble("y")); + Z.z().ops_route.plus(Z.z().opl).setDouble("x", sps.plus(pi).getStruct().x); + Z.z().ops_route.plus(Z.z().opl).setDouble("y", sps.plus(pi).getStruct().y); Z.z().opl++; } return 1; @@ -333,7 +334,7 @@ LEAVING("987ednrgu5qo9dzhpiox47mhb","splinefits"); //3 b6eghkeu16aum3l778ig52ht1 // static int splineisinside(Pedge_t * edges, int edgen, Ppoint_t * sps) -public static boolean splineisinside(__ptr__ edges, int edgen, ST_pointf.Array sps) { +public static boolean splineisinside(ST_Pedge_t.Array edges, int edgen, ST_pointf.Array sps) { ENTERING("b6eghkeu16aum3l778ig52ht1","splineisinside"); try { double roots[] = new double[4]; @@ -343,8 +344,8 @@ try { final ST_pointf ip = new ST_pointf(); double t, ta, tb, tc, td; for (ei = 0; ei < edgen; ei++) { - lps.plus(0).setStruct(edges.plus(ei).getStruct("a")); - lps.plus(1).setStruct(edges.plus(ei).getStruct("b")); + lps.plus(0).setStruct(edges.get(ei).a); + lps.plus(1).setStruct(edges.get(ei).b); /* if ((rootn = splineintersectsline (sps, lps, roots)) == 4) return 1; */ if ((rootn = splineintersectsline(sps, lps, roots)) == 4) @@ -357,10 +358,10 @@ try { tc = 3 * t * t * (1 - t); tb = 3 * t * (1 - t) * (1 - t); ta = (1 - t) * (1 - t) * (1 - t); - ip.setDouble("x", ta * sps.plus(0).getDouble("x") + tb * sps.plus(1).getDouble("x") + - tc * sps.plus(2).getDouble("x") + td * sps.plus(3).getDouble("x")); - ip.setDouble("y", ta * sps.plus(0).getDouble("y") + tb * sps.plus(1).getDouble("y") + - tc * sps.plus(2).getDouble("y") + td * sps.plus(3).getDouble("y")); + ip.setDouble("x", ta * sps.get(0).x + tb * sps.get(1).x + + tc * sps.get(2).x + td * sps.get(3).x); + ip.setDouble("y", ta * sps.get(0).y + tb * sps.get(1).y + + tc * sps.get(2).y + td * sps.get(3).y); if (DISTSQ(ip, lps.plus(0).getStruct()) < 1E-3 || DISTSQ(ip, lps.plus(1).getStruct()) < 1E-3) continue; @@ -389,17 +390,17 @@ try { double tv, sv, rat; int rootn[] = new int[]{0}; int xrootn, yrootn, i, j; - xcoeff[0] = lps.plus(0).getStruct().getDouble("x"); - xcoeff[1] = lps.plus(1).getStruct().getDouble("x") - lps.plus(0).getStruct().getDouble("x"); - ycoeff[0] = lps.plus(0).getStruct().getDouble("y"); - ycoeff[1] = lps.plus(1).getStruct().getDouble("y") - lps.plus(0).getStruct().getDouble("y"); + xcoeff[0] = lps.plus(0).getStruct().x; + xcoeff[1] = lps.plus(1).getStruct().x - lps.plus(0).getStruct().x; + ycoeff[0] = lps.plus(0).getStruct().y; + ycoeff[1] = lps.plus(1).getStruct().y - lps.plus(0).getStruct().y; rootn[0] = 0; if (xcoeff[1] == 0) { if (ycoeff[1] == 0) { - points2coeff(sps.plus(0).getStruct().getDouble("x"), sps.plus(1).getStruct().getDouble("x"), sps.plus(2).getStruct().getDouble("x"), sps.plus(3).getStruct().getDouble("x"), scoeff); + points2coeff(sps.plus(0).getStruct().x, sps.plus(1).getStruct().x, sps.plus(2).getStruct().x, sps.plus(3).getStruct().x, scoeff); scoeff[0] -= xcoeff[0]; xrootn = solve3(scoeff, xroots); - points2coeff(sps.plus(0).getStruct().getDouble("y"), sps.plus(1).getStruct().getDouble("y"), sps.plus(2).getStruct().getDouble("y"), sps.plus(3).getStruct().getDouble("y"), scoeff); + points2coeff(sps.plus(0).getStruct().y, sps.plus(1).getStruct().y, sps.plus(2).getStruct().y, sps.plus(3).getStruct().y, scoeff); scoeff[0] -= ycoeff[0]; yrootn = solve3(scoeff, yroots); if (xrootn == 4) @@ -418,7 +419,7 @@ try { addroot(xroots[i], roots, rootn); return rootn[0]; } else { - points2coeff(sps.plus(0).getStruct().getDouble("x"), sps.plus(1).getStruct().getDouble("x"), sps.plus(2).getStruct().getDouble("x"), sps.plus(3).getStruct().getDouble("x"), scoeff); + points2coeff(sps.plus(0).getStruct().x, sps.plus(1).getStruct().x, sps.plus(2).getStruct().x, sps.plus(3).getStruct().x, scoeff); scoeff[0] -= xcoeff[0]; xrootn = solve3(scoeff, xroots); if (xrootn == 4) @@ -426,7 +427,7 @@ try { for (i = 0; i < xrootn; i++) { tv = xroots[i]; if (tv >= 0 && tv <= 1) { - points2coeff(sps.plus(0).getStruct().getDouble("y"), sps.plus(1).getStruct().getDouble("y"), sps.plus(2).getStruct().getDouble("y"), sps.plus(3).getStruct().getDouble("y"), + points2coeff(sps.plus(0).getStruct().y, sps.plus(1).getStruct().y, sps.plus(2).getStruct().y, sps.plus(3).getStruct().y, scoeff); sv = scoeff[0] + tv * (scoeff[1] + tv * (scoeff[2] + tv * scoeff[3])); @@ -439,8 +440,8 @@ try { } } else { rat = ycoeff[1] / xcoeff[1]; - points2coeff(sps.plus(0).getStruct().getDouble("y") - rat * sps.plus(0).getStruct().getDouble("x"), sps.plus(1).getStruct().getDouble("y") - rat * sps.plus(1).getStruct().getDouble("x"), - sps.plus(2).getStruct().getDouble("y") - rat * sps.plus(2).getStruct().getDouble("x"), sps.plus(3).getStruct().getDouble("y") - rat * sps.plus(3).getStruct().getDouble("x"), + points2coeff(sps.plus(0).getStruct().y - rat * sps.plus(0).getStruct().x, sps.plus(1).getStruct().y - rat * sps.plus(1).getStruct().x, + sps.plus(2).getStruct().y - rat * sps.plus(2).getStruct().x, sps.plus(3).getStruct().y - rat * sps.plus(3).getStruct().x, scoeff); scoeff[0] += rat * xcoeff[0] - ycoeff[0]; xrootn = solve3(scoeff, xroots); @@ -449,7 +450,7 @@ try { for (i = 0; i < xrootn; i++) { tv = xroots[i]; if (tv >= 0 && tv <= 1) { - points2coeff(sps.plus(0).getStruct().getDouble("x"), sps.plus(1).getStruct().getDouble("x"), sps.plus(2).getStruct().getDouble("x"), sps.plus(3).getStruct().getDouble("x"), + points2coeff(sps.plus(0).getStruct().x, sps.plus(1).getStruct().x, sps.plus(2).getStruct().x, sps.plus(3).getStruct().x, scoeff); sv = scoeff[0] + tv * (scoeff[1] + tv * (scoeff[2] + tv * scoeff[3])); @@ -512,11 +513,11 @@ private static ST_pointf normv_w_(final ST_pointf v) { ENTERING("3i8m1m9fg7qmnt8jloorwlu8e","normv"); try { double d; - d = v.getDouble("x") * v.getDouble("x") + v.getDouble("y") * v.getDouble("y"); + d = v.x * v.x + v.y * v.y; if (d > 1e-6) { d = sqrt(d); - v.setDouble("x", v.getDouble("x") / d); - v.setDouble("y", v.getDouble("y") / d); + v.setDouble("x", v.x / d); + v.setDouble("y", v.y / d); } return v; } finally { @@ -563,8 +564,8 @@ return add_w_(p1.copy(), p2.copy()).copy(); private static ST_pointf add_w_(final ST_pointf p1, final ST_pointf p2) { ENTERING("f4a7nt247bokdwr2owda050of","add"); try { - p1.setDouble("x", p1.getDouble("x") + p2.getDouble("x")); - p1.setDouble("y", p1.getDouble("y") + p2.getDouble("y")); + p1.setDouble("x", p1.x + p2.x); + p1.setDouble("y", p1.y + p2.y); return p1; } finally { LEAVING("f4a7nt247bokdwr2owda050of","add"); @@ -583,8 +584,8 @@ return sub_w_(p1.copy(), p2.copy()).copy(); private static ST_pointf sub_w_(final ST_pointf p1, final ST_pointf p2) { ENTERING("c4l1gvlkv2s4mi6os7r9dh89f","sub"); try { - p1.setDouble("x", p1.getDouble("x") - p2.getDouble("x")); - p1.setDouble("y", p1.getDouble("y") - p2.getDouble("y")); + p1.setDouble("x", p1.x - p2.x); + p1.setDouble("y", p1.y - p2.y); return p1; } finally { LEAVING("c4l1gvlkv2s4mi6os7r9dh89f","sub"); @@ -604,8 +605,8 @@ private static double dist_w_(final ST_pointf p1, final ST_pointf p2) { ENTERING("dqnlz0tceriykws4ngudl94w9","dist"); try { double dx, dy; - dx = p2.getDouble("x") - p1.getDouble("x"); - dy = p2.getDouble("y") - p1.getDouble("y"); + dx = p2.x - p1.x; + dy = p2.y - p1.y; return sqrt(dx * dx + dy * dy); } finally { LEAVING("dqnlz0tceriykws4ngudl94w9","dist"); @@ -624,8 +625,8 @@ return scale_w_(p.copy(), c).copy(); private static ST_pointf scale_w_(final ST_pointf p, double c) { ENTERING("19149pdllzhplvew0bsh5v6hy","scale"); try { - p.setDouble("x", p.getDouble("x") * c); - p.setDouble("y", p.getDouble("y") * c); + p.setDouble("x", p.x * c); + p.setDouble("y", p.y * c); return p; } finally { LEAVING("19149pdllzhplvew0bsh5v6hy","scale"); @@ -644,7 +645,7 @@ return dot_w_(p1.copy(), p2.copy()); private static double dot_w_(final ST_pointf p1, final ST_pointf p2) { ENTERING("7ebsa2s1eoopqj1pp43bh5fw","dot"); try { - return p1.getDouble("x") * p2.getDouble("x") + p1.getDouble("y") * p2.getDouble("y"); + return p1.x * p2.x + p1.y * p2.y; } finally { LEAVING("7ebsa2s1eoopqj1pp43bh5fw","dot"); } diff --git a/src/gen/lib/pathplan/shortest__c.java b/src/gen/lib/pathplan/shortest__c.java index 70f0691b3..15f372e31 100644 --- a/src/gen/lib/pathplan/shortest__c.java +++ b/src/gen/lib/pathplan/shortest__c.java @@ -130,31 +130,31 @@ try { Z.z().dq.lpnlpi = Z.z().dq.fpnlpi - 1; /* make sure polygon is CCW and load pnls array */ for (pi = 0, minx = HUGE_VAL, minpi = -1; pi < polyp.pn; pi++) { - if (minx > polyp.ps.get(pi).getDouble("x")) - { minx = polyp.ps.get(pi).getDouble("x"); + if (minx > polyp.ps.get(pi).x) + { minx = polyp.ps.get(pi).x; minpi = pi; } } p2.____(polyp.ps.plus(minpi)); p1.____(polyp.ps.plus(((minpi == 0) ? polyp.pn - 1 : minpi - 1))); p3.____(polyp.ps.plus(((minpi == polyp.pn - 1) ? 0 : minpi + 1))); - if (((p1.getDouble("x") == p2.getDouble("x") && p2.getDouble("x") == p3.getDouble("x")) && (p3.getDouble("y") > p2.getDouble("y"))) || + if (((p1.x == p2.x && p2.x == p3.x) && (p3.y > p2.y)) || ccw(p1, p2, p3) != 1) { for (pi = polyp.pn - 1; pi >= 0; pi--) { if (pi < polyp.pn - 1 - && polyp.ps.plus(pi).getDouble("x") == polyp.ps.plus(pi+1).getDouble("x") - && polyp.ps.plus(pi).getDouble("y") == polyp.ps.plus(pi+1).getDouble("y")) + && polyp.ps.get(pi).x == polyp.ps.get(pi+1).x + && polyp.ps.get(pi).y == polyp.ps.get(pi+1).y) continue; - Z.z().pnls[Z.z().pnll].pp = (ST_pointf) ((ST_pointf)polyp.ps.plus(pi).getPtr()); + Z.z().pnls[Z.z().pnll].pp = (ST_pointf) ((ST_pointf)polyp.ps.get(pi)); Z.z().pnls[Z.z().pnll].link = Z.z().pnls[Z.z().pnll % polyp.pn]; Z.z().pnlps[Z.z().pnll] = Z.z().pnls[Z.z().pnll]; Z.z().pnll++; } } else { for (pi = 0; pi < polyp.pn; pi++) { - if (pi > 0 && polyp.ps.plus(pi).getDouble("x") == polyp.ps.plus(pi - 1).getDouble("x") && - polyp.ps.plus(pi).getDouble("y") == polyp.ps.plus(pi - 1).getDouble("y")) + if (pi > 0 && polyp.ps.get(pi).x == polyp.ps.get(pi - 1).x && + polyp.ps.get(pi).y == polyp.ps.get(pi - 1).y) continue; - Z.z().pnls[Z.z().pnll].pp = (ST_pointf) ((ST_pointf)polyp.ps.plus(pi).getPtr()); + Z.z().pnls[Z.z().pnll].pp = (ST_pointf) ((ST_pointf)polyp.ps.get(pi)); Z.z().pnls[Z.z().pnll].link = Z.z().pnls[Z.z().pnll % polyp.pn]; Z.z().pnlps[Z.z().pnll] = Z.z().pnls[Z.z().pnll]; Z.z().pnll++; @@ -168,7 +168,7 @@ try { connecttris(trii, trij); /* find first and last triangles */ for (trii = 0; trii < Z.z().tril; trii++) - if (pointintri(trii, (__ptr__) eps.plus(0).getStruct())) + if (pointintri(trii, eps.plus(0).getStruct())) break; if (trii == Z.z().tril) { UNSUPPORTED("4ma3y8l4lmjcsw49kmsgknig6"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("source point not in any triangle")); @@ -176,7 +176,7 @@ UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1; } ftrii = trii; for (trii = 0; trii < Z.z().tril; trii++) - if (pointintri(trii, (__ptr__) eps.plus(1).getStruct())) + if (pointintri(trii, eps.plus(1).getStruct())) break; if (trii == Z.z().tril) { System.err.println("libpath/%s:%d: %s\n" + "graphviz-2.38.0\\lib\\pathplan\\shortest.c" + 26 + ("destination point not in any triangle")); @@ -203,9 +203,9 @@ UNSUPPORTED("3rcg6c9s9nmostq9c3r5n6x4h"); // output->ps = ops; UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0; } /* build funnel and shortest path linked list (in add2dq) */ - epnls[0].pp = (ST_pointf) ((ST_pointf)eps.plus(0).asPtr().getPtr()); + epnls[0].pp = eps.get(0); epnls[0].link = null; - epnls[1].pp = (ST_pointf) ((ST_pointf)eps.plus(1).asPtr().getPtr()); + epnls[1].pp = eps.get(1); epnls[1].link = null; add2dq(1, epnls[0]); Z.z().dq.apex = Z.z().dq.fpnlpi; @@ -216,10 +216,10 @@ UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0; /* find the left and right points of the exiting edge */ for (ei = 0; ei < 3; ei++) if (trip.get(0).e[ei].rtp!=null && - trip.get(0).e[ei].rtp.get(0).getInt("mark") == 1) + trip.get(0).e[ei].rtp.get(0).mark == 1) break; if (ei == 3) { /* in last triangle */ - if (ccw(eps.plus(1).asPtr(), Z.z().dq.pnlps[Z.z().dq.fpnlpi].pp, + if (ccw(eps.get(1), Z.z().dq.pnlps[Z.z().dq.fpnlpi].pp, Z.z().dq.pnlps[Z.z().dq.lpnlpi].pp) == 1) { lpnlp = Z.z().dq.pnlps[Z.z().dq.lpnlpi]; @@ -266,7 +266,7 @@ UNSUPPORTED("2cii65lhw4wb8nyvjv702v7md"); // lpnlp = trip->e[ei].pnl1p, rpnlp trii = -1; for (ei = 0; ei < 3; ei++) if (trip.get(0).e[ei].rtp!=null && - trip.get(0).e[ei].rtp.get(0).getInt("mark") == 1) { + trip.get(0).e[ei].rtp.get(0).mark == 1) { trii = trip.get(0).e[ei].rtp.minus(Z.z().tris); break; } @@ -521,12 +521,12 @@ LEAVING("9dnrc8vqpffp5t3bmsackgqtl","finddqsplit"); //3 72h03s8inxtto2ekvmuqjtj3d // static int ccw(Ppoint_t * p1p, Ppoint_t * p2p, Ppoint_t * p3p) -public static int ccw(__ptr__ p1p, __ptr__ p2p, __ptr__ p3p) { +public static int ccw(ST_pointf p1p, ST_pointf p2p, ST_pointf p3p) { ENTERING("72h03s8inxtto2ekvmuqjtj3d","ccw"); try { double d; - d = ((p1p.getDouble("y") - p2p.getDouble("y")) * (p3p.getDouble("x") - p2p.getDouble("x"))) - - ((p3p.getDouble("y") - p2p.getDouble("y")) * (p1p.getDouble("x") - p2p.getDouble("x"))); + d = ((p1p.y - p2p.y) * (p3p.x - p2p.x)) - + ((p3p.y - p2p.y) * (p1p.x - p2p.x)); return (d > 0) ? 1 : ((d < 0) ? 2 : 3); } finally { LEAVING("72h03s8inxtto2ekvmuqjtj3d","ccw"); @@ -538,7 +538,7 @@ LEAVING("72h03s8inxtto2ekvmuqjtj3d","ccw"); //3 22a9ajg9t8ovqsigk3tyu3rkd // static int intersects(Ppoint_t * pap, Ppoint_t * pbp, Ppoint_t * pcp, Ppoint_t * pdp) -public static boolean intersects(__ptr__ pap, __ptr__ pbp, __ptr__ pcp, __ptr__ pdp) { +public static boolean intersects(ST_pointf pap, ST_pointf pbp, ST_pointf pcp, ST_pointf pdp) { ENTERING("22a9ajg9t8ovqsigk3tyu3rkd","intersects"); try { int ccw1, ccw2, ccw3, ccw4; @@ -565,18 +565,18 @@ LEAVING("22a9ajg9t8ovqsigk3tyu3rkd","intersects"); //3 uh5n18rzyevtb4cwpni70qpc // static int between(Ppoint_t * pap, Ppoint_t * pbp, Ppoint_t * pcp) -public static boolean between(__ptr__ pap, __ptr__ pbp, __ptr__ pcp) { +public static boolean between(ST_pointf pap, ST_pointf pbp, ST_pointf pcp) { ENTERING("uh5n18rzyevtb4cwpni70qpc","between"); try { final ST_pointf p1 = new ST_pointf(), p2 = new ST_pointf(); - p1.setDouble("x", pbp.getDouble("x") - pap.getDouble("x")); - p1.setDouble("y", pbp.getDouble("y") - pap.getDouble("y")); - p2.setDouble("x", pcp.getDouble("x") - pap.getDouble("x")); - p2.setDouble("y", pcp.getDouble("y") - pap.getDouble("y")); + p1.setDouble("x", pbp.x - pap.x); + p1.setDouble("y", pbp.y - pap.y); + p2.setDouble("x", pcp.x - pap.x); + p2.setDouble("y", pcp.y - pap.y); if (ccw(pap, pbp, pcp) != 3) return false; - return (p2.getDouble("x") * p1.getDouble("x") + p2.getDouble("y") * p1.getDouble("y") >= 0) && - (p2.getDouble("x") * p2.getDouble("x") + p2.getDouble("y") * p2.getDouble("y") <= p1.getDouble("x") * p1.getDouble("x") + p1.getDouble("y") * p1.getDouble("y")); + return (p2.x * p1.x + p2.y * p1.y >= 0) && + (p2.x * p2.x + p2.y * p2.y <= p1.x * p1.x + p1.y * p1.y); } finally { LEAVING("uh5n18rzyevtb4cwpni70qpc","between"); } @@ -587,7 +587,7 @@ LEAVING("uh5n18rzyevtb4cwpni70qpc","between"); //3 zti1mzm2m7tr2xwnbf7e8u3d // static int pointintri(int trii, Ppoint_t * pp) -public static boolean pointintri(int trii, __ptr__ pp) { +public static boolean pointintri(int trii, ST_pointf pp) { ENTERING("zti1mzm2m7tr2xwnbf7e8u3d","pointintri"); try { int ei, sum; diff --git a/src/h/Dthold_t.java b/src/h/Dthold_t.java deleted file mode 100644 index 3d6fdb58f..000000000 --- a/src/h/Dthold_t.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of Smetana. - * Smetana is a partial translation of Graphviz/Dot sources from C to Java. - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * This translation is distributed under the same Licence as the original C program: - * - ************************************************************************* - * Copyright (c) 2011 AT&T Intellectual Property - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: See CVS logs. Details at http://www.graphviz.org/ - ************************************************************************* - * - * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC - * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0] - * - * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES - * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - * - * You may obtain a copy of the License at - * - * http://www.eclipse.org/legal/epl-v10.html - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package h; -import java.util.Arrays; -import java.util.List; - -//2 1tob3f90syune1bxwbffctfmj - -public interface Dthold_t extends _dthold_s { - public static List DEFINITION = Arrays.asList( -"typedef struct _dthold_s Dthold_t"); -} - -// typedef struct _dthold_s Dthold_t; \ No newline at end of file diff --git a/src/h/ST_Agclos_s.java b/src/h/ST_Agclos_s.java index 7b95a3030..f55dc78e6 100644 --- a/src/h/ST_Agclos_s.java +++ b/src/h/ST_Agclos_s.java @@ -47,7 +47,6 @@ package h; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; -import smetana.core.__struct__; import smetana.core.amiga.StarStruct; public class ST_Agclos_s extends UnsupportedStructAndPtr { @@ -77,30 +76,6 @@ public class ST_Agclos_s extends UnsupportedStructAndPtr { return parent; } - @Override - public boolean getBoolean(String fieldName) { - if (fieldName.equals("callbacks_enabled")) { - return callbacks_enabled; - } - return super.getBoolean(fieldName); - } - - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("strdict")) { - return strdict; - } - if (fieldName.equals("cb")) { - return cb; - } - if (fieldName.equals("disc")) { - return disc; - } - if (fieldName.equals("state")) { - return state; - } - return super.getPtr(fieldName); - } @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { @@ -111,26 +86,6 @@ public class ST_Agclos_s extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("disc")) { - return disc; - } - if (fieldName.equals("state")) { - return state; - } - return super.getStruct(fieldName); - } - - @Override - public void setBoolean(String fieldName, boolean data) { - if (fieldName.equals("callbacks_enabled")) { - this.callbacks_enabled = data; - return; - } - super.setBoolean(fieldName, data); - } - // public interface ST_Agclos_s extends __ptr__ { // public static List DEFINITION = Arrays.asList( // "struct Agclos_s", diff --git a/src/h/ST_Agdatadict_s.java b/src/h/ST_Agdatadict_s.java index fa41bca5b..ca82cc470 100644 --- a/src/h/ST_Agdatadict_s.java +++ b/src/h/ST_Agdatadict_s.java @@ -45,7 +45,6 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.amiga.StarStruct; @@ -53,9 +52,9 @@ import smetana.core.amiga.StarStruct; public class ST_Agdatadict_s extends UnsupportedStructAndPtr { private final ST_Agrec_s h = new ST_Agrec_s(this); /* installed in list of graph recs */ - public ST_dt_s n; - public ST_dt_s e; - public ST_dt_s g; + public ST_dt_s dict_n; + public ST_dt_s dict_e; + public ST_dt_s dict_g; private final StarStruct parent; @@ -74,34 +73,20 @@ public class ST_Agdatadict_s extends UnsupportedStructAndPtr { @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { if (fieldName.equals("dict.n")) { - this.n = (ST_dt_s) newData; - return n; + this.dict_n = (ST_dt_s) newData; + return dict_n; } if (fieldName.equals("dict.e")) { - this.e = (ST_dt_s) newData; - return e; + this.dict_e = (ST_dt_s) newData; + return dict_e; } if (fieldName.equals("dict.g")) { - this.g = (ST_dt_s) newData; - return g; + this.dict_g = (ST_dt_s) newData; + return dict_g; } return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("dict.n")) { - return n; - } - if (fieldName.equals("dict.e")) { - return e; - } - if (fieldName.equals("dict.g")) { - return g; - } - return super.getPtr(fieldName); - } - @Override public __ptr__ castTo(Class dest) { if (dest == ST_Agrec_s.class) { diff --git a/src/h/ST_Agdisc_s.java b/src/h/ST_Agdisc_s.java index efebe579b..47493c6d5 100644 --- a/src/h/ST_Agdisc_s.java +++ b/src/h/ST_Agdisc_s.java @@ -86,16 +86,6 @@ public class ST_Agdisc_s extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("mem")) { - return mem; - } - if (fieldName.equals("id")) { - return id; - } - return super.getPtr(fieldName); - } // public static List DEFINITION = Arrays.asList( // "struct Agdisc_s", diff --git a/src/h/ST_Agdstate_s.java b/src/h/ST_Agdstate_s.java index 9ca01798d..1855b4e2a 100644 --- a/src/h/ST_Agdstate_s.java +++ b/src/h/ST_Agdstate_s.java @@ -81,16 +81,6 @@ public class ST_Agdstate_s extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("mem")) { - return mem; - } - if (fieldName.equals("id")) { - return id; - } - return super.getPtr(fieldName); - } // public static List DEFINITION = Arrays.asList( // "struct Agdstate_s", diff --git a/src/h/ST_Agedge_s.java b/src/h/ST_Agedge_s.java index 8c1e9b4de..cb52a7366 100644 --- a/src/h/ST_Agedge_s.java +++ b/src/h/ST_Agedge_s.java @@ -51,7 +51,6 @@ import java.util.List; import smetana.core.HardcodedStruct; import smetana.core.OFFSET; import smetana.core.UnsupportedArrayOfPtr; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__array_of_ptr__; import smetana.core.__ptr__; @@ -103,6 +102,11 @@ public class ST_Agedge_s extends UnsupportedStructAndPtr implements HardcodedStr public ArrayOfStar plus(int delta) { return new ArrayOfStar(data, pos + delta); } + + public ST_Agedge_s get(int i) { + return plus(i).getPtr(); + } + @Override public ArrayOfStar asPtr() { @@ -134,6 +138,7 @@ public class ST_Agedge_s extends UnsupportedStructAndPtr implements HardcodedStr } return this.pos == other.pos; } + } @Override @@ -198,6 +203,11 @@ public class ST_Agedge_s extends UnsupportedStructAndPtr implements HardcodedStr } return super.castTo(dest); } + + public ST_Agobj_s castTo_ST_Agobj_s() { + return base; + } + @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { @@ -208,27 +218,11 @@ public class ST_Agedge_s extends UnsupportedStructAndPtr implements HardcodedStr return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("node")) { - return node; - } - return super.getPtr(fieldName); - } - @Override public ST_Agedge_s getPtr() { return this; } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("base")) { - return base; - } - return super.getStruct(fieldName); - } - public StarStruct from_seq_link(ST_dtlink_s from) { if (from == seq_link) { return this; @@ -243,6 +237,7 @@ public class ST_Agedge_s extends UnsupportedStructAndPtr implements HardcodedStr throw new IllegalArgumentException(); } + // public interface ST_Agedge_s extends __ptr__ { // public static List DEFINITION = Arrays.asList( // "struct Agedge_s", diff --git a/src/h/ST_Agedgeinfo_t.java b/src/h/ST_Agedgeinfo_t.java index 04c24ec10..0d9300645 100644 --- a/src/h/ST_Agedgeinfo_t.java +++ b/src/h/ST_Agedgeinfo_t.java @@ -45,7 +45,6 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.__struct__; @@ -138,15 +137,6 @@ public class ST_Agedgeinfo_t extends UnsupportedStructAndPtr { super.setStruct(fieldName, newData); } - @Override - public void setBoolean(String fieldName, boolean data) { - if (fieldName.equals("label_ontop")) { - this.label_ontop = data; - return; - } - super.setBoolean(fieldName, data); - } - @Override public void setDouble(String fieldName, double data) { if (fieldName.equals("dist")) { @@ -197,93 +187,6 @@ public class ST_Agedgeinfo_t extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public double getDouble(String fieldName) { - if (fieldName.equals("dist")) { - return this.dist; - } - return super.getDouble(fieldName); - } - - @Override - public boolean getBoolean(String fieldName) { - if (fieldName.equals("conc_opp_flag")) { - return this.conc_opp_flag; - } - if (fieldName.equals("label_ontop")) { - return this.label_ontop; - } - return super.getBoolean(fieldName); - } - - @Override - public int getInt(String fieldName) { - if (fieldName.equals("minlen")) { - return this.minlen; - } - if (fieldName.equals("weight")) { - return this.weight; - } - if (fieldName.equals("cutvalue")) { - return this.cutvalue; - } - if (fieldName.equals("tree_index")) { - return this.tree_index; - } - if (fieldName.equals("count")) { - return this.count; - } - if (fieldName.equals("xpenalty")) { - return this.xpenalty; - } - if (fieldName.equals("showboxes")) { - return this.showboxes; - } - if (fieldName.equals("edge_type")) { - return this.edge_type; - } - if (fieldName.equals("adjacent")) { - return this.adjacent; - } - return super.getInt(fieldName); - } - - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("to_virt")) { - return this.to_virt; - } - if (fieldName.equals("to_orig")) { - return this.to_orig; - } - if (fieldName.equals("label")) { - return this.label; - } - if (fieldName.equals("spl")) { - return this.spl; - } - if (fieldName.equals("xlabel")) { - return this.xlabel; - } - if (fieldName.equals("head_label")) { - return this.head_label; - } - if (fieldName.equals("tail_label")) { - return this.tail_label; - } - return super.getPtr(fieldName); - } - - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("tail_port")) { - return this.tail_port; - } - if (fieldName.equals("head_port")) { - return this.head_port; - } - return super.getStruct(fieldName); - } @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { diff --git a/src/h/ST_Agedgepair_s.java b/src/h/ST_Agedgepair_s.java index 529e3abbb..a9b1b1742 100644 --- a/src/h/ST_Agedgepair_s.java +++ b/src/h/ST_Agedgepair_s.java @@ -46,9 +46,7 @@ package h; import smetana.core.HardcodedStruct; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; -import smetana.core.__struct__; import smetana.core.amiga.StarStruct; public class ST_Agedgepair_s extends UnsupportedStructAndPtr implements HardcodedStruct { @@ -66,17 +64,6 @@ public class ST_Agedgepair_s extends UnsupportedStructAndPtr implements Hardcode this.parent = parent; } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("out")) { - return out; - } - if (fieldName.equals("in")) { - return in; - } - return super.getStruct(fieldName); - } - // public static List DEFINITION = Arrays.asList( // "struct Agedgepair_s", // "{", diff --git a/src/h/ST_Agiddisc_s.java b/src/h/ST_Agiddisc_s.java index 334cd7550..df679832d 100644 --- a/src/h/ST_Agiddisc_s.java +++ b/src/h/ST_Agiddisc_s.java @@ -47,7 +47,6 @@ package h; import smetana.core.CFunction; import smetana.core.UnsupportedStructAndPtr; -import smetana.core.__ptr__; public class ST_Agiddisc_s extends UnsupportedStructAndPtr { @@ -59,30 +58,6 @@ public class ST_Agiddisc_s extends UnsupportedStructAndPtr { public CFunction close; public CFunction idregister; - @Override - public Object call(String fieldName, Object... args) { - if (fieldName.equals("open")) { - return open.exe(args); - } - if (fieldName.equals("map")) { - return map.exe(args); - } - if (fieldName.equals("idregister")) { - return idregister.exe(args); - } - if (fieldName.equals("print")) { - return print.exe(args); - } - return super.call(fieldName, args); - } - - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("print")) { - return print; - } - return super.getPtr(fieldName); - } // public static List DEFINITION = Arrays.asList( // "struct Agiddisc_s", diff --git a/src/h/ST_Agmemdisc_s.java b/src/h/ST_Agmemdisc_s.java index b8b824c56..31f29347f 100644 --- a/src/h/ST_Agmemdisc_s.java +++ b/src/h/ST_Agmemdisc_s.java @@ -46,9 +46,7 @@ package h; import smetana.core.CFunction; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; -import smetana.core.amiga.StarStruct; public class ST_Agmemdisc_s extends UnsupportedStructAndPtr { @@ -58,20 +56,6 @@ public class ST_Agmemdisc_s extends UnsupportedStructAndPtr { public CFunction free; public CFunction close; - @Override - public Object call(String fieldName, Object... args) { - if (fieldName.equals("open")) { - return open.exe(args); - } - if (fieldName.equals("alloc")) { - return alloc.exe(args); - } - if (fieldName.equals("resize")) { - return resize.exe(args); - } - return super.call(fieldName, args); - } - // public static List DEFINITION = Arrays.asList( // "struct Agmemdisc_s", // "{", diff --git a/src/h/ST_Agnode_s.java b/src/h/ST_Agnode_s.java index 129548585..e0bc05785 100644 --- a/src/h/ST_Agnode_s.java +++ b/src/h/ST_Agnode_s.java @@ -48,7 +48,6 @@ package h; import java.util.ArrayList; import java.util.List; -import smetana.core.CString; import smetana.core.UnsupportedArrayOfPtr; import smetana.core.UnsupportedArrayOfStruct2; import smetana.core.UnsupportedStructAndPtr; @@ -112,6 +111,10 @@ public class ST_Agnode_s extends UnsupportedStructAndPtr { public void setPtr(__ptr__ value) { this.data.set(pos, (ST_Agnode_s) value); } + + public ST_Agnode_s get(int i) { + return plus(i).getPtr(); + } @Override public ST_Agnode_s getPtr() { @@ -211,13 +214,6 @@ public class ST_Agnode_s extends UnsupportedStructAndPtr { throw new UnsupportedOperationException(getClass().toString()); } - public CString getCString() { - throw new UnsupportedOperationException(getClass().toString()); - } - - public void setCString(CString value) { - throw new UnsupportedOperationException(getClass().toString()); - } } @@ -243,6 +239,10 @@ public class ST_Agnode_s extends UnsupportedStructAndPtr { } return super.castTo(dest); } + + public ST_Agobj_s castTo_ST_Agobj_s() { + return base; + } @Override public boolean isSameThan(StarStruct other) { @@ -250,17 +250,6 @@ public class ST_Agnode_s extends UnsupportedStructAndPtr { return this == other2; } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("base")) { - return base; - } - if (fieldName.equals("mainsub")) { - return mainsub; - } - return super.getStruct(fieldName); - } - @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { if (fieldName.equals("root")) { @@ -271,15 +260,7 @@ public class ST_Agnode_s extends UnsupportedStructAndPtr { } @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("root")) { - return root; - } - return super.getPtr(fieldName); - } - - @Override - public __struct__ getStruct() { + public ST_Agnode_s getStruct() { return this; } diff --git a/src/h/ST_Agnodeinfo_t.java b/src/h/ST_Agnodeinfo_t.java index f47711f03..4293a8eef 100644 --- a/src/h/ST_Agnodeinfo_t.java +++ b/src/h/ST_Agnodeinfo_t.java @@ -153,42 +153,6 @@ public class ST_Agnodeinfo_t extends UnsupportedStructAndPtr { super.setDouble(fieldName, data); } - @Override - public double getDouble(String fieldName) { - if (fieldName.equals("width")) { - return this.width; - } - if (fieldName.equals("height")) { - return this.height; - } - if (fieldName.equals("ht")) { - return this.ht; - } - if (fieldName.equals("lw")) { - return this.lw; - } - if (fieldName.equals("rw")) { - return this.rw; - } - if (fieldName.equals("mval")) { - return this.mval; - } - return super.getDouble(fieldName); - } - - @Override - public void setBoolean(String fieldName, boolean data) { - if (fieldName.equals("mark")) { - this.mark = data ? 1 : 0; - return; - } - if (fieldName.equals("onstack")) { - this.onstack = data ? 1 : 0; - return; - } - super.setBoolean(fieldName, data); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("showboxes")) { @@ -242,67 +206,6 @@ public class ST_Agnodeinfo_t extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("UF_size")) { - return this.UF_size; - } - if (fieldName.equals("ranktype")) { - return this.ranktype; - } - if (fieldName.equals("mark")) { - return this.mark; - } - if (fieldName.equals("onstack")) { - return this.onstack; - } - if (fieldName.equals("priority")) { - return this.priority; - } - if (fieldName.equals("node_type")) { - return this.node_type; - } - if (fieldName.equals("rank")) { - return this.rank; - } - if (fieldName.equals("order")) { - return this.order; - } - if (fieldName.equals("ranktype")) { - return this.ranktype; - } - if (fieldName.equals("low")) { - return this.low; - } - if (fieldName.equals("lim")) { - return this.lim; - } - if (fieldName.equals("weight_class")) { - return this.weight_class; - } - if (fieldName.equals("id")) { - return this.id; - } - if (fieldName.equals("heapindex")) { - return this.heapindex; - } - if (fieldName.equals("hops")) { - return this.hops; - } - return super.getInt(fieldName); - } - - @Override - public boolean getBoolean(String fieldName) { - if (fieldName.equals("onstack")) { - return this.onstack != 0; - } - if (fieldName.equals("has_port")) { - return this.has_port; - } - return super.getBoolean(fieldName); - } - @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { if (fieldName.equals("shape")) { @@ -344,81 +247,7 @@ public class ST_Agnodeinfo_t extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("shape")) { - return shape; - } - if (fieldName.equals("label")) { - return label; - } - if (fieldName.equals("UF_parent")) { - return UF_parent; - } - if (fieldName.equals("next")) { - return next; - } - if (fieldName.equals("prev")) { - return prev; - } - if (fieldName.equals("clust")) { - return clust; - } - if (fieldName.equals("inleaf")) { - return inleaf; - } - if (fieldName.equals("outleaf")) { - return outleaf; - } - if (fieldName.equals("alg")) { - return alg; - } - if (fieldName.equals("par")) { - return par; - } - if (fieldName.equals("xlabel")) { - return xlabel; - } - if (fieldName.equals("shape_info")) { - return shape_info; - } - return super.getPtr(fieldName); - } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("in")) { - return in; - } - if (fieldName.equals("out")) { - return out; - } - if (fieldName.equals("flat_out")) { - return flat_out; - } - if (fieldName.equals("flat_in")) { - return flat_in; - } - if (fieldName.equals("other")) { - return other; - } - if (fieldName.equals("save_in")) { - return save_in; - } - if (fieldName.equals("save_out")) { - return save_out; - } - if (fieldName.equals("tree_in")) { - return tree_in; - } - if (fieldName.equals("tree_out")) { - return tree_out; - } - if (fieldName.equals("coord")) { - return coord; - } - return super.getStruct(fieldName); - } @Override public void setStruct(String fieldName, __struct__ newData) { diff --git a/src/h/ST_Agobj_s.java b/src/h/ST_Agobj_s.java index b9b88607c..c50cd6968 100644 --- a/src/h/ST_Agobj_s.java +++ b/src/h/ST_Agobj_s.java @@ -46,7 +46,6 @@ package h; import smetana.core.HardcodedStruct; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.__struct__; @@ -113,22 +112,6 @@ public class ST_Agobj_s extends UnsupportedStructAndPtr implements WithParent, H return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("data")) { - return data; - } - return super.getPtr(fieldName); - } - - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("tag")) { - return tag; - } - return super.getStruct(fieldName); - } - @Override public void setStruct(String fieldName, __struct__ newData) { if (fieldName.equals("tag")) { diff --git a/src/h/ST_Agraph_s.java b/src/h/ST_Agraph_s.java index 79c03ad92..c2d807e1b 100644 --- a/src/h/ST_Agraph_s.java +++ b/src/h/ST_Agraph_s.java @@ -48,10 +48,8 @@ package h; import java.util.ArrayList; import java.util.List; -import smetana.core.CString; import smetana.core.OFFSET; import smetana.core.UnsupportedArrayOfStruct2; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__array_of_ptr__; import smetana.core.__ptr__; @@ -88,7 +86,7 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr { public StarStruct getParent() { return _parent; } - + @Override public ST_Agraph_s getStruct() { return this; @@ -107,47 +105,42 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr { public ST_Agraph_s getPtr() { return this; } - - public static class Array extends UnsupportedArrayOfStruct2 implements __ptr__, __array_of_ptr__{ + + public static class Array extends UnsupportedArrayOfStruct2 implements __ptr__, __array_of_ptr__ { private final List data; private final int pos; - + @Override public void setStruct(String fieldName, __struct__ data) { getStruct().setStruct(fieldName, data); } - + @Override public __ptr__ castTo(Class dest) { return getStruct().castTo(dest); } - + @Override public void setPtr(__ptr__ value) { this.data.set(pos, (ST_Agraph_s) value); } - + @Override public ST_Agraph_s getPtr() { return this.data.get(pos); } - - @Override - public __struct__ getStruct(String fieldName) { - return getStruct().getStruct(fieldName); - } - + @Override public Array asPtr() { return this; } - + @Override public ST_Agraph_s getStruct() { return data.get(pos); } - + public Array(int size) { this.data = new ArrayList(); this.pos = 0; @@ -162,7 +155,7 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr { } return this; } - + public Array plus(int delta) { return plusJ(delta); } @@ -199,18 +192,8 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr { throw new UnsupportedOperationException(getClass().toString()); } - public CString getCString() { - throw new UnsupportedOperationException(getClass().toString()); - } - - public void setCString(CString value) { - throw new UnsupportedOperationException(getClass().toString()); - } - } - - @Override public Object addVirtualBytes(int virtualBytes) { if (virtualBytes == 0) { @@ -227,14 +210,6 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr { return super.addVirtualBytes(virtualBytes); } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("desc")) { - return desc; - } - return super.getStruct(fieldName); - } - @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { if (fieldName.equals("clos")) { @@ -272,35 +247,6 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("clos")) { - return clos; - } - if (fieldName.equals("root")) { - return root; - } - if (fieldName.equals("parent")) { - return parent; - } - if (fieldName.equals("n_id")) { - return n_id; - } - if (fieldName.equals("n_seq")) { - return n_seq; - } - if (fieldName.equals("e_id")) { - return e_id; - } - if (fieldName.equals("e_seq")) { - return e_seq; - } - if (fieldName.equals("g_dict")) { - return g_dict; - } - return super.getPtr(fieldName); - } - @Override public __ptr__ castTo(Class dest) { if (dest == ST_Agobj_s.class) { @@ -312,6 +258,10 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr { return super.castTo(dest); } + public ST_Agobj_s castTo_ST_Agobj_s() { + return base; + } + @Override public boolean isSameThan(StarStruct other) { ST_Agraph_s other2 = (ST_Agraph_s) other; @@ -324,9 +274,6 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr { } throw new IllegalArgumentException(); } - - - // // public interface ST_Agraph_s extends __ptr__ { diff --git a/src/h/ST_Agraphinfo_t.java b/src/h/ST_Agraphinfo_t.java index c23571e05..330c3ff01 100644 --- a/src/h/ST_Agraphinfo_t.java +++ b/src/h/ST_Agraphinfo_t.java @@ -119,7 +119,7 @@ public class ST_Agraphinfo_t extends UnsupportedStructAndPtr implements Hardcode public ST_Agnode_s.Array rankleader; public boolean expanded; public int installed; - // char set_type; + public int set_type; public int label_pos; public int exact_ranksep; @@ -155,22 +155,6 @@ public class ST_Agraphinfo_t extends UnsupportedStructAndPtr implements Hardcode border[pos].copyDataFrom(value); } - @Override - public double getDouble(String fieldName) { - return getStruct().getDouble(fieldName); - } - - } - - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("comp")) { - return this.comp; - } - if (fieldName.equals("bb")) { - return this.bb; - } - return super.getStruct(fieldName); } @Override @@ -242,69 +226,6 @@ public class ST_Agraphinfo_t extends UnsupportedStructAndPtr implements Hardcode return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("drawing")) { - return drawing; - } - if (fieldName.equals("gvc")) { - return gvc; - } - if (fieldName.equals("parent")) { - return parent; - } - if (fieldName.equals("dotroot")) { - return dotroot; - } - if (fieldName.equals("clust")) { - return clust; - } - if (fieldName.equals("label")) { - return label; - } - if (fieldName.equals("maxset")) { - return maxset; - } - if (fieldName.equals("minset")) { - return minset; - } - if (fieldName.equals("nlist")) { - return nlist; - } - if (fieldName.equals("leader")) { - return leader; - } - if (fieldName.equals("rankleader")) { - return rankleader; - } - if (fieldName.equals("rank")) { - return rank; - } - if (fieldName.equals("ln")) { - return ln; - } - if (fieldName.equals("rn")) { - return rn; - } - if (fieldName.equals("cleanup")) { - return cleanup; - } - return super.getPtr(fieldName); - } - - @Override - public void setBoolean(String fieldName, boolean data) { - if (fieldName.equals("expanded")) { - this.expanded = data; - return; - } - if (fieldName.equals("has_flat_edges")) { - this.has_flat_edges = data ? 1 : 0; - return; - } - super.setBoolean(fieldName, data); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("charset")) { @@ -366,71 +287,6 @@ public class ST_Agraphinfo_t extends UnsupportedStructAndPtr implements Hardcode super.setInt(fieldName, data); } - @Override - public boolean getBoolean(String fieldName) { - if (fieldName.equals("expanded")) { - return expanded; - } - return super.getBoolean(fieldName); - } - - @Override - public int getInt(String fieldName) { - if (fieldName.equals("flags")) { - return flags; - } - if (fieldName.equals("charset")) { - return charset; - } - if (fieldName.equals("rankdir")) { - return rankdir; - } - if (fieldName.equals("has_labels")) { - return has_labels; - } - if (fieldName.equals("n_cluster")) { - return n_cluster; - } - if (fieldName.equals("label_pos")) { - return label_pos; - } - if (fieldName.equals("n_nodes")) { - return n_nodes; - } - if (fieldName.equals("maxrank")) { - return maxrank; - } - if (fieldName.equals("minrank")) { - return minrank; - } - if (fieldName.equals("has_flat_edges")) { - return has_flat_edges; - } - if (fieldName.equals("installed")) { - return installed; - } - if (fieldName.equals("exact_ranksep")) { - return exact_ranksep; - } - if (fieldName.equals("nodesep")) { - return nodesep; - } - if (fieldName.equals("ranksep")) { - return ranksep; - } - return super.getInt(fieldName); - } - - @Override - public double getDouble(String fieldName) { - if (fieldName.equals("ht1")) { - return ht1; - } - if (fieldName.equals("ht2")) { - return ht2; - } - return super.getDouble(fieldName); - } @Override public void setDouble(String fieldName, double data) { diff --git a/src/h/ST_Agrec_s.java b/src/h/ST_Agrec_s.java index 78c7e1c02..f17469269 100644 --- a/src/h/ST_Agrec_s.java +++ b/src/h/ST_Agrec_s.java @@ -46,7 +46,6 @@ package h; import smetana.core.CString; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.__struct__; @@ -88,14 +87,6 @@ public class ST_Agrec_s extends UnsupportedStructAndPtr implements WithParent { return this == other2; } - @Override - public CString getCString(String fieldName) { - if (fieldName.equals("name")) { - return name; - } - return super.getCString(fieldName); - } - @Override public __ptr__ castTo(Class dest) { if (dest == ST_Agdatadict_s.class && getParent() instanceof ST_Agdatadict_s) { @@ -117,6 +108,22 @@ public class ST_Agrec_s extends UnsupportedStructAndPtr implements WithParent { System.err.println("getParent=" + getParent().getClass()); return super.castTo(dest); } + + public ST_Agnodeinfo_t castTo_ST_Agnodeinfo_t() { + if (getParent() instanceof ST_Agnodeinfo_t) { + return (ST_Agnodeinfo_t) getParent(); + } + throw new UnsupportedOperationException(); + } + + + + public ST_Agraphinfo_t castTo_ST_Agraphinfo_t() { + if (getParent() instanceof ST_Agraphinfo_t) { + return (ST_Agraphinfo_t) getParent(); + } + throw new UnsupportedOperationException(); + } @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { @@ -133,14 +140,6 @@ public class ST_Agrec_s extends UnsupportedStructAndPtr implements WithParent { return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("next")) { - return next; - } - return super.getPtr(fieldName); - } - // public static List DEFINITION = Arrays.asList( // "struct Agrec_s", // "{", diff --git a/src/h/ST_Agsubnode_s.java b/src/h/ST_Agsubnode_s.java index af9c1f9fb..c6a18996f 100644 --- a/src/h/ST_Agsubnode_s.java +++ b/src/h/ST_Agsubnode_s.java @@ -142,25 +142,6 @@ public class ST_Agsubnode_s extends UnsupportedStructAndPtr implements Hardcoded return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("node")) { - return node; - } - if (fieldName.equals("in_id")) { - return in_id; - } - if (fieldName.equals("out_seq")) { - return out_seq; - } - if (fieldName.equals("out_id")) { - return out_id; - } - if (fieldName.equals("in_seq")) { - return in_seq; - } - return super.getPtr(fieldName); - } // public interface ST_Agsubnode_s extends __ptr__ { // public static List DEFINITION = Arrays.asList( diff --git a/src/h/ST_Agsym_s.java b/src/h/ST_Agsym_s.java index 0861187f2..8c5ce4064 100644 --- a/src/h/ST_Agsym_s.java +++ b/src/h/ST_Agsym_s.java @@ -48,7 +48,6 @@ package h; import smetana.core.CString; import smetana.core.HardcodedStruct; import smetana.core.OFFSET; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.amiga.StarStruct; @@ -123,28 +122,6 @@ public class ST_Agsym_s extends UnsupportedStructAndPtr implements HardcodedStru super.setInt(fieldName, data); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("kind")) { - return kind; - } - if (fieldName.equals("id")) { - return id; - } - return super.getInt(fieldName); - } - - @Override - public CString getCString(String fieldName) { - if (fieldName.equals("defval")) { - return defval; - } - if (fieldName.equals("name")) { - return name; - } - return super.getCString(fieldName); - } - public StarStruct from_link(ST_dtlink_s from) { if (from == link) { return this; diff --git a/src/h/ST_BestPos_t.java b/src/h/ST_BestPos_t.java index 6ea4ca4c8..7bdd3b903 100644 --- a/src/h/ST_BestPos_t.java +++ b/src/h/ST_BestPos_t.java @@ -45,7 +45,6 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__struct__; import smetana.core.amiga.StarStruct; @@ -54,9 +53,9 @@ public class ST_BestPos_t extends UnsupportedStructAndPtr { private final StarStruct parent; - private int n; - private double area; - private final ST_pointf pos = new ST_pointf(this); + public int n; + public double area; + public final ST_pointf pos = new ST_pointf(this); public ST_BestPos_t() { this(null); @@ -92,22 +91,6 @@ public class ST_BestPos_t extends UnsupportedStructAndPtr { super.setStruct(fieldName, newData); } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("pos")) { - return pos; - } - return super.getStruct(fieldName); - } - - @Override - public int getInt(String fieldName) { - if (fieldName.equals("n")) { - return this.n; - } - return super.getInt(fieldName); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("n")) { @@ -117,14 +100,6 @@ public class ST_BestPos_t extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public double getDouble(String fieldName) { - if (fieldName.equals("area")) { - return this.area; - } - return super.getDouble(fieldName); - } - @Override public void setDouble(String fieldName, double data) { if (fieldName.equals("area")) { diff --git a/src/h/ST_Branch_t.java b/src/h/ST_Branch_t.java index a4335c895..19089fc19 100644 --- a/src/h/ST_Branch_t.java +++ b/src/h/ST_Branch_t.java @@ -49,17 +49,12 @@ import smetana.core.HardcodedStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.__struct__; -import smetana.core.amiga.StarStruct; public class ST_Branch_t extends UnsupportedStructAndPtr implements HardcodedStruct { - // Warning : could be a "ST_Leaf_t" + // Warning : could be a "ST_Leaf_t" from C Version public final ST_Rect_t rect = new ST_Rect_t(this); - private ST_Node_t___ child; // "data" : ST_object_t - private Object child2; - - public ST_Branch_t(StarStruct parent) { - } + public ST_Node_t___or_object_t child; // "data" : ST_object_t public ST_Branch_t() { } @@ -69,9 +64,7 @@ public class ST_Branch_t extends UnsupportedStructAndPtr implements HardcodedStr ST_Branch_t this2 = (ST_Branch_t) other; this.rect.copyDataFrom((__struct__) this2.rect); this.child = this2.child; - this.child2 = this2.child2; } - @Override public __ptr__ castTo(Class dest) { @@ -84,19 +77,10 @@ public class ST_Branch_t extends UnsupportedStructAndPtr implements HardcodedStr return super.castTo(dest); } - - @Override - public ST_Rect_t getStruct(String fieldName) { - if (fieldName.equals("rect")) { - return rect; - } - throw new UnsupportedOperationException(); - } - public __struct__ getStruct() { return this; } - + @Override public void ___(__struct__ other) { this.copyDataFrom(other); @@ -112,42 +96,12 @@ public class ST_Branch_t extends UnsupportedStructAndPtr implements HardcodedStr } @Override - public __ptr__ setPtr(String fieldName, __ptr__ newData) { + public ST_Node_t___or_object_t setPtr(String fieldName, __ptr__ newData) { if (fieldName.equals("child")) { - if (newData instanceof ST_Node_t___) { - this.child = (ST_Node_t___) newData; - return this.child; - } else if (newData != null) { - // System.err.println("****************************************WARNING1 " + newData); - this.child2 = newData; - return (__ptr__) this.child2; - } else if (newData == null) { - this.child = null; - this.child2 = null; - return null; - } - } - return super.setPtr(fieldName, newData); - } - - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("child")) { - if (this.child2 != null) { - // System.err.println("****************************************WARNING2 " + child2); - return (__ptr__) child2; - } + this.child = (ST_Node_t___or_object_t) newData; return this.child; } - if (fieldName.equals("data")) { - // From ST_leaf_t - if (this.child2 != null) { - // System.err.println("****************************************WARNING3 " + child2); - return (__ptr__) child2; - } - return this.child; - } - return super.getPtr(fieldName); + throw new UnsupportedOperationException(); } // typedef struct Branch { diff --git a/src/h/ST_GVCOMMON_t.java b/src/h/ST_GVCOMMON_t.java index 56e45b479..55e1e05c8 100644 --- a/src/h/ST_GVCOMMON_t.java +++ b/src/h/ST_GVCOMMON_t.java @@ -47,7 +47,6 @@ package h; import smetana.core.CFunction; import smetana.core.HardcodedStruct; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.amiga.StarStruct; @@ -98,23 +97,6 @@ public class ST_GVCOMMON_t extends UnsupportedStructAndPtr implements HardcodedS return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("builtins") && builtins == null) { - return builtins; - } - return super.getPtr(fieldName); - } - - @Override - public void setBoolean(String fieldName, boolean data) { - if (fieldName.equals("demand_loading")) { - this.demand_loading = data; - return; - } - super.setBoolean(fieldName, data); - } - } // typedef struct GVCOMMON_s { diff --git a/src/h/ST_GVC_s.java b/src/h/ST_GVC_s.java index 49a9772ae..c30a0f601 100644 --- a/src/h/ST_GVC_s.java +++ b/src/h/ST_GVC_s.java @@ -46,9 +46,7 @@ package h; import smetana.core.HardcodedStruct; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; -import smetana.core.__struct__; import smetana.core.amiga.StarStruct; public class ST_GVC_s extends UnsupportedStructAndPtr implements HardcodedStruct { @@ -105,17 +103,6 @@ public class ST_GVC_s extends UnsupportedStructAndPtr implements HardcodedStruct this.parent = parent; } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("common")) { - return common; - } - if (fieldName.equals("layout")) { - return layout; - } - return super.getStruct(fieldName); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("config_found")) { diff --git a/src/h/ST_HDict_t.java b/src/h/ST_HDict_t.java index 8ad310f56..c530d50e2 100644 --- a/src/h/ST_HDict_t.java +++ b/src/h/ST_HDict_t.java @@ -46,9 +46,7 @@ package h; import smetana.core.OFFSET; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; -import smetana.core.__struct__; import smetana.core.amiga.StarStruct; public class ST_HDict_t extends UnsupportedStructAndPtr { @@ -57,7 +55,7 @@ public class ST_HDict_t extends UnsupportedStructAndPtr { public final ST_dtlink_s link = new ST_dtlink_s(this); public int key; - public final ST_Leaf_t d = new ST_Leaf_t(this); + public final ST_Branch_t d = new ST_Branch_t(); /* Should be ST_Leaf_t */ public ST_HDict_t() { this(null); @@ -82,14 +80,6 @@ public class ST_HDict_t extends UnsupportedStructAndPtr { return super.addVirtualBytes(virtualBytes); } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("d")) { - return this.d; - } - return super.getStruct(fieldName); - } - // @Override // public __ptr__ getPtr(String fieldName) { // if (fieldName.equals("d")) { diff --git a/src/h/ST_LeafList_t.java b/src/h/ST_LeafList_t.java index 4bd0f24bb..bd604c132 100644 --- a/src/h/ST_LeafList_t.java +++ b/src/h/ST_LeafList_t.java @@ -45,50 +45,16 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; -import smetana.core.__ptr__; -import smetana.core.amiga.StarStruct; public class ST_LeafList_t extends UnsupportedStructAndPtr { - private final StarStruct parent; - public ST_LeafList_t next; - public __ptr__ /*ST_Leaf_t*/ leaf; + public ST_Branch_t /* ST_Leaf_t */leaf; public ST_LeafList_t() { - this(null); } - public ST_LeafList_t(StarStruct parent) { - this.parent = parent; - } - - @Override - public __ptr__ setPtr(String fieldName, __ptr__ newData) { - if (fieldName.equals("next")) { - this.next = (ST_LeafList_t) newData; - return this.next; - } - if (fieldName.equals("leaf")) { - this.leaf = newData; - return this.leaf; - } - return super.setPtr(fieldName, newData); - } - - - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("next")) { - return this.next; - } - if (fieldName.equals("leaf")) { - return this.leaf; - } - return super.getPtr(fieldName); - } // typedef struct LeafList { // struct LeafList *next; diff --git a/src/h/ST_Leaf_t.java b/src/h/ST_Leaf_t.java deleted file mode 100644 index 5622c3e49..000000000 --- a/src/h/ST_Leaf_t.java +++ /dev/null @@ -1,110 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of Smetana. - * Smetana is a partial translation of Graphviz/Dot sources from C to Java. - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * This translation is distributed under the same Licence as the original C program: - * - ************************************************************************* - * Copyright (c) 2011 AT&T Intellectual Property - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: See CVS logs. Details at http://www.graphviz.org/ - ************************************************************************* - * - * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC - * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0] - * - * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES - * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - * - * You may obtain a copy of the License at - * - * http://www.eclipse.org/legal/epl-v10.html - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package h; - -import smetana.core.UnsupportedStarStruct; -import smetana.core.UnsupportedStructAndPtr; -import smetana.core.__ptr__; -import smetana.core.__struct__; -import smetana.core.amiga.StarStruct; - -public class ST_Leaf_t extends UnsupportedStructAndPtr { - - private final StarStruct parent; - - // typedef struct Leaf { - public final ST_Rect_t rect = new ST_Rect_t(this); - public __ptr__ data; - - // } Leaf_t; - - public ST_Leaf_t() { - this(null); - } - - public ST_Leaf_t(StarStruct parent) { - this.parent = parent; - } - - @Override - public void setStruct(String fieldName, __struct__ newData) { - if (fieldName.equals("rect")) { - this.rect.copyDataFrom(newData); - return; - } - super.setStruct(fieldName, newData); - } - - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("rect")) { - return this.rect; - } - return super.getStruct(fieldName); - } - - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("data")) { - return this.data; - } - return super.getPtr(fieldName); - } - - @Override - public __ptr__ setPtr(String fieldName, __ptr__ newData) { - if (fieldName.equals("data")) { - this.data = newData; - return this.data; - } - return super.setPtr(fieldName, newData); - } - - // typedef struct Leaf { - // Rect_t rect; - // void *data; - // } Leaf_t; -} diff --git a/src/h/ST_Node_t___.java b/src/h/ST_Node_t___.java index 944fe95a9..22e2848fa 100644 --- a/src/h/ST_Node_t___.java +++ b/src/h/ST_Node_t___.java @@ -46,12 +46,11 @@ package h; import smetana.core.UnsupportedArrayOfStruct; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__struct__; import smetana.core.amiga.StarStruct; -public class ST_Node_t___ extends UnsupportedStructAndPtr { +public class ST_Node_t___ extends UnsupportedStructAndPtr implements ST_Node_t___or_object_t { private final StarStruct parent; public int count; @@ -102,11 +101,6 @@ public class ST_Node_t___ extends UnsupportedStructAndPtr { branch[pos].copyDataFrom(value); } - @Override - public double getDouble(String fieldName) { - return getStruct().getDouble(fieldName); - } - } @Override @@ -122,16 +116,6 @@ public class ST_Node_t___ extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("count")) { - return this.count; - } - if (fieldName.equals("level")) { - return this.level; - } - return super.getInt(fieldName); - } // "typedef struct Node", // "{", diff --git a/src/h/ST_PartitionVars.java b/src/h/ST_PartitionVars.java index 8a8e65b1d..5ea7aed3a 100644 --- a/src/h/ST_PartitionVars.java +++ b/src/h/ST_PartitionVars.java @@ -45,12 +45,8 @@ */ package h; -import smetana.core.ArrayOfInteger; import smetana.core.UnsupportedArrayOfStruct; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; -import smetana.core.__array_of_integer__; -import smetana.core.__ptr__; import smetana.core.__struct__; import smetana.core.amiga.StarStruct; diff --git a/src/h/ST_Pedge_t.java b/src/h/ST_Pedge_t.java index 7f36c93a5..f180cf0a0 100644 --- a/src/h/ST_Pedge_t.java +++ b/src/h/ST_Pedge_t.java @@ -48,9 +48,7 @@ package h; import java.util.ArrayList; import java.util.List; -import smetana.core.CString; import smetana.core.UnsupportedArrayOfStruct2; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__array_of_ptr__; import smetana.core.__ptr__; @@ -73,8 +71,8 @@ public class ST_Pedge_t extends UnsupportedStructAndPtr { // "typedef struct Pedge_t", // "{", // "Ppoint_t a, b", - private final ST_pointf a = new ST_pointf(this); - private final ST_pointf b = new ST_pointf(this); + public final ST_pointf a = new ST_pointf(this); + public final ST_pointf b = new ST_pointf(this); // "}", // "Pedge_t"); @@ -90,11 +88,6 @@ public class ST_Pedge_t extends UnsupportedStructAndPtr { getStruct().setStruct(fieldName, data); } - @Override - public __struct__ getStruct(String fieldName) { - return getStruct().getStruct(fieldName); - } - @Override public Array asPtr() { return this; @@ -156,28 +149,10 @@ public class ST_Pedge_t extends UnsupportedStructAndPtr { throw new UnsupportedOperationException(getClass().toString()); } - public CString getCString() { - throw new UnsupportedOperationException(getClass().toString()); - } - - public void setCString(CString value) { - throw new UnsupportedOperationException(getClass().toString()); - } } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("a")) { - return a; - } - if (fieldName.equals("b")) { - return b; - } - return super.getStruct(fieldName); - } - @Override public void setStruct(String fieldName, __struct__ newData) { if (fieldName.equals("a")) { diff --git a/src/h/ST_Ppoly_t.java b/src/h/ST_Ppoly_t.java index 3b1da2cb9..8eb791e36 100644 --- a/src/h/ST_Ppoly_t.java +++ b/src/h/ST_Ppoly_t.java @@ -47,7 +47,6 @@ package h; import smetana.core.HardcodedStruct; import smetana.core.UnsupportedArrayOfStruct; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__struct__; import smetana.core.amiga.Area; @@ -110,14 +109,6 @@ public class ST_Ppoly_t extends UnsupportedStructAndPtr implements HardcodedStru super.setInt(fieldName, data); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("pn")) { - return pn; - } - return super.getInt(fieldName); - } - // public static List DEFINITION = Arrays.asList( // "typedef struct Ppoly_t", // "{", diff --git a/src/h/ST_RTree.java b/src/h/ST_RTree.java index df7aad8f6..90b501396 100644 --- a/src/h/ST_RTree.java +++ b/src/h/ST_RTree.java @@ -45,10 +45,8 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; -import smetana.core.__struct__; import smetana.core.amiga.StarStruct; public class ST_RTree extends UnsupportedStructAndPtr { @@ -78,7 +76,7 @@ public class ST_RTree extends UnsupportedStructAndPtr { // "int ReInsertCount", // "int InSplitCount", // "int DeSplitCount", - // "int ElimCount", + public int ElimCount; // "int EvalCount", // "int InTouchCount", // "int DeTouchCount", @@ -94,22 +92,6 @@ public class ST_RTree extends UnsupportedStructAndPtr { // "int HitCount", // "}"); - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("root")) { - return root; - } - return super.getPtr(fieldName); - } - - @Override - public ST_SplitQ_t getStruct(String fieldName) { - if (fieldName.equals("split")) { - return split; - } - throw new UnsupportedOperationException(); - } - @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { if (fieldName.equals("root")) { @@ -119,43 +101,6 @@ public class ST_RTree extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("NodeCount")) { - return NodeCount; - } - if (fieldName.equals("LeafCount")) { - return LeafCount; - } - if (fieldName.equals("Deleting")) { - return Deleting; - } - if (fieldName.equals("RectCount")) { - return RectCount; - } - if (fieldName.equals("EntryCount")) { - return EntryCount; - } - if (fieldName.equals("SeTouchCount")) { - return SeTouchCount; - } - if (fieldName.equals("MinFill")) { - return MinFill; - } - if (fieldName.equals("NonLeafCount")) { - return NonLeafCount; - } - return super.getInt(fieldName); - } - - @Override - public boolean getBoolean(String fieldName) { - if (fieldName.equals("StatFlag")) { - return StatFlag != 0; - } - return super.getBoolean(fieldName); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("NodeCount")) { diff --git a/src/h/ST_SplitQ_t.java b/src/h/ST_SplitQ_t.java index eefcf8e09..8349b1d05 100644 --- a/src/h/ST_SplitQ_t.java +++ b/src/h/ST_SplitQ_t.java @@ -144,22 +144,6 @@ public class ST_SplitQ_t extends UnsupportedStructAndPtr { } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("CoverSplit")) { - return this.CoverSplit; - } - return super.getStruct(fieldName); - } - - @Override - public int getInt(String fieldName) { - if (fieldName.equals("CoverSplitArea")) { - return this.CoverSplitArea; - } - return super.getInt(fieldName); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("CoverSplitArea")) { diff --git a/src/h/ST_XLabels_t.java b/src/h/ST_XLabels_t.java index e06db5c97..d1b189c98 100644 --- a/src/h/ST_XLabels_t.java +++ b/src/h/ST_XLabels_t.java @@ -73,17 +73,6 @@ public class ST_XLabels_t extends UnsupportedStructAndPtr { // "}", // "XLabels_t"); - @Override - public int getInt(String fieldName) { - if (fieldName.equals("n_objs")) { - return n_objs; - } - if (fieldName.equals("n_lbls")) { - return n_lbls; - } - return super.getInt(fieldName); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("n_objs")) { @@ -98,25 +87,6 @@ public class ST_XLabels_t extends UnsupportedStructAndPtr { } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("hdx")) { - return this.hdx; - } - if (fieldName.equals("spdx")) { - return this.spdx; - } - if (fieldName.equals("objs")) { - return this.objs; - } - if (fieldName.equals("lbls")) { - return this.lbls; - } - if (fieldName.equals("params")) { - return this.params; - } - return super.getPtr(fieldName); - } @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { diff --git a/src/h/ST_adjmatrix_t.java b/src/h/ST_adjmatrix_t.java index 24a1ffab3..be4e0bc9a 100644 --- a/src/h/ST_adjmatrix_t.java +++ b/src/h/ST_adjmatrix_t.java @@ -83,17 +83,6 @@ public class ST_adjmatrix_t extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("nrows")) { - return this.nrows; - } - if (fieldName.equals("ncols")) { - return this.ncols; - } - return super.getInt(fieldName); - } - } // typedef struct adjmatrix_t { diff --git a/src/h/ST_arrowdir_t.java b/src/h/ST_arrowdir_t.java index fef7bf7b7..8c5af1e35 100644 --- a/src/h/ST_arrowdir_t.java +++ b/src/h/ST_arrowdir_t.java @@ -45,7 +45,6 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.amiga.StarStruct; diff --git a/src/h/ST_arrowtype_t.java b/src/h/ST_arrowtype_t.java index be6b3ae1e..31fe50838 100644 --- a/src/h/ST_arrowtype_t.java +++ b/src/h/ST_arrowtype_t.java @@ -47,7 +47,6 @@ package h; import smetana.core.CFunction; import smetana.core.UnsupportedStructAndPtr; -import smetana.core.__ptr__; import smetana.core.__struct__; public class ST_arrowtype_t extends UnsupportedStructAndPtr { diff --git a/src/h/ST_aspect_t.java b/src/h/ST_aspect_t.java index 847d52061..2f4063ba4 100644 --- a/src/h/ST_aspect_t.java +++ b/src/h/ST_aspect_t.java @@ -45,7 +45,6 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.amiga.StarStruct; @@ -74,17 +73,6 @@ public class ST_aspect_t extends UnsupportedStructAndPtr { // "}", // "aspect_t"); - @Override - public int getInt(String fieldName) { - if (fieldName.equals("nextIter")) { - return this.nextIter; - } - if (fieldName.equals("nPasses")) { - return this.nPasses; - } - return super.getInt(fieldName); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("nextIter")) { @@ -102,14 +90,6 @@ public class ST_aspect_t extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public boolean getBoolean(String fieldName) { - if (fieldName.equals("badGraph")) { - return this.badGraph != 0; - } - return super.getBoolean(fieldName); - } - } // typedef struct aspect_t { diff --git a/src/h/ST_bezier.java b/src/h/ST_bezier.java index c06d8d25d..90ddde0f1 100644 --- a/src/h/ST_bezier.java +++ b/src/h/ST_bezier.java @@ -51,7 +51,6 @@ import java.util.ArrayList; import java.util.List; import smetana.core.UnsupportedArrayOfPtr; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__array_of_ptr__; import smetana.core.__ptr__; @@ -112,16 +111,6 @@ public class ST_bezier extends UnsupportedStructAndPtr { getStruct().setInt(fieldName, data); } - @Override - public __struct__ getStruct(String fieldName) { - return getStruct().getStruct(fieldName); - } - - @Override - public int getInt(String fieldName) { - return getStruct().getInt(fieldName); - } - // public void swap(int i, int j) { // ST_bezier e1 = data.get(i); // ST_bezier e2 = data.get(j); @@ -160,6 +149,10 @@ public class ST_bezier extends UnsupportedStructAndPtr { public ST_bezier getPtr() { return this.data.get(pos); } + + public ST_bezier get(int i) { + return this.plus(i).getPtr(); + } @Override public int comparePointer(__ptr__ other) { @@ -197,17 +190,6 @@ public class ST_bezier extends UnsupportedStructAndPtr { ___(((ST_bezier) other).getStruct()); } - @Override - public boolean getBoolean(String fieldName) { - if (fieldName.equals("sflag")) { - return this.sflag != 0; - } - if (fieldName.equals("eflag")) { - return this.eflag != 0; - } - return super.getBoolean(fieldName); - } - @Override public void setStruct(String fieldName, __struct__ newData) { if (fieldName.equals("sp")) { @@ -238,20 +220,6 @@ public class ST_bezier extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("size")) { - return this.size; - } - if (fieldName.equals("sflag")) { - return this.sflag; - } - if (fieldName.equals("eflag")) { - return this.eflag; - } - return super.getInt(fieldName); - } - @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { if (fieldName.equals("list")) { @@ -261,17 +229,6 @@ public class ST_bezier extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("sp")) { - return this.sp; - } - if (fieldName.equals("ep")) { - return this.ep; - } - return super.getStruct(fieldName); - } - @Override public ST_bezier getStruct() { return this; diff --git a/src/h/ST_boxf.java b/src/h/ST_boxf.java index 99c8b09f9..50db1e63c 100644 --- a/src/h/ST_boxf.java +++ b/src/h/ST_boxf.java @@ -46,7 +46,6 @@ package h; import smetana.core.HardcodedStruct; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__struct__; import smetana.core.amiga.StarStruct; @@ -87,17 +86,6 @@ public class ST_boxf extends UnsupportedStructAndPtr implements HardcodedStruct copyDataFrom(value); } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("LL")) { - return LL; - } - if (fieldName.equals("UR")) { - return UR; - } - return super.getStruct(fieldName); - } - public __struct__ getStructInternal(String fieldName) { if (fieldName.equals("LL")) { return LL; diff --git a/src/h/ST_cinfo_t.java b/src/h/ST_cinfo_t.java index 55fd0f652..451f11ff2 100644 --- a/src/h/ST_cinfo_t.java +++ b/src/h/ST_cinfo_t.java @@ -47,14 +47,13 @@ package h; import smetana.core.HardcodedStruct; import smetana.core.UnsupportedStructAndPtr; -import smetana.core.__ptr__; import smetana.core.__struct__; import smetana.core.amiga.StarStruct; public class ST_cinfo_t extends UnsupportedStructAndPtr implements HardcodedStruct { public final ST_boxf bb = new ST_boxf(this); - public __ptr__ objp; // ST_object_t + public ST_object_t.Array objp; public ST_cinfo_t(StarStruct parent) { } @@ -78,32 +77,6 @@ public class ST_cinfo_t extends UnsupportedStructAndPtr implements HardcodedStru super.setStruct(fieldName, newData); } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("bb")) { - return bb; - } - return super.getStruct(fieldName); - } - - - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("objp")) { - return this.objp; - } - return super.getPtr(fieldName); - } - - - @Override - public __ptr__ setPtr(String fieldName, __ptr__ newData) { - if (fieldName.equals("objp")) { - this.objp = newData; - return this.objp; - } - return super.setPtr(fieldName, newData); - } @Override public ST_cinfo_t copy() { diff --git a/src/h/ST_dt_s.java b/src/h/ST_dt_s.java index b9b7bef9a..10466ac82 100644 --- a/src/h/ST_dt_s.java +++ b/src/h/ST_dt_s.java @@ -110,42 +110,6 @@ public class ST_dt_s extends UnsupportedStructAndPtr implements HardcodedStruct return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("disc")) { - return disc; - } - if (fieldName.equals("data")) { - return data; - } - if (fieldName.equals("meth")) { - return meth; - } - if (fieldName.equals("view")) { - return view; - } - return super.getPtr(fieldName); - } - - @Override - public Object call(String fieldName, Object... args) { - if (fieldName.equals("memoryf")) { - return this.memoryf.exe(args); - } - if (fieldName.equals("searchf")) { - return this.searchf.exe(args); - } - return super.call(fieldName, args); - } - - @Override - public __ptr__ castTo(Class dest) { - if (dest == ST_dt_s.class) { - return this; - } - return super.castTo(dest); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("type")) { @@ -159,17 +123,6 @@ public class ST_dt_s extends UnsupportedStructAndPtr implements HardcodedStruct super.setInt(fieldName, data); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("type")) { - return type; - } - if (fieldName.equals("nview")) { - return nview; - } - return super.getInt(fieldName); - } - @Override public boolean isSameThan(StarStruct other) { ST_dt_s other2 = (ST_dt_s) other; diff --git a/src/h/ST_dtdata_s.java b/src/h/ST_dtdata_s.java index 960202129..8206fc936 100644 --- a/src/h/ST_dtdata_s.java +++ b/src/h/ST_dtdata_s.java @@ -45,7 +45,6 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.amiga.StarStruct; @@ -103,23 +102,6 @@ public class ST_dtdata_s extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("type")) { - return type; - } - if (fieldName.equals("size")) { - return size; - } - if (fieldName.equals("minp")) { - return minp; - } - if (fieldName.equals("ntab")) { - return ntab; - } - return super.getInt(fieldName); - } - // public interface ST_dtdata_s extends __ptr__ { // public static List DEFINITION = Arrays.asList( // "struct _dtdata_s", diff --git a/src/h/ST_dtdisc_s.java b/src/h/ST_dtdisc_s.java index 79c718cad..217a09053 100644 --- a/src/h/ST_dtdisc_s.java +++ b/src/h/ST_dtdisc_s.java @@ -46,7 +46,6 @@ package h; import smetana.core.CFunction; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.amiga.StarStruct; @@ -70,40 +69,6 @@ public class ST_dtdisc_s extends UnsupportedStructAndPtr { this(null); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("memoryf")) { - return memoryf; - } - if (fieldName.equals("eventf")) { - return eventf; - } - if (fieldName.equals("comparf")) { - return comparf; - } - if (fieldName.equals("makef")) { - return makef; - } - if (fieldName.equals("freef")) { - return freef; - } - return super.getPtr(fieldName); - } - - @Override - public int getInt(String fieldName) { - if (fieldName.equals("key")) { - return key; - } - if (fieldName.equals("size")) { - return size; - } - if (fieldName.equals("link")) { - return link; - } - return super.getInt(fieldName); - } - @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { if (fieldName.equals("memoryf")) { diff --git a/src/h/ST_dthold_s.java b/src/h/ST_dthold_s.java index bc00c76c8..5f63e2e97 100644 --- a/src/h/ST_dthold_s.java +++ b/src/h/ST_dthold_s.java @@ -45,7 +45,6 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.amiga.StarStruct; @@ -66,14 +65,14 @@ public class ST_dthold_s extends UnsupportedStructAndPtr { // "{", // "Dtlink_t hdr", // "void* obj", - private final ST_dtlink_s hdr = new ST_dtlink_s(this); - private __ptr__ obj; + public final ST_dtlink_s hdr = new ST_dtlink_s(this); + public __ptr__ obj; // "}"); @Override public __ptr__ castTo(Class dest) { - if (dest == _dthold_s.class) { + if (dest == ST_dthold_s.class) { return this; } if (dest == ST_dtlink_s.class) { @@ -91,13 +90,6 @@ public class ST_dthold_s extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("obj")) { - return this.obj; - } - return super.getPtr(fieldName); - } } // struct _dthold_s diff --git a/src/h/ST_dtlink_s.java b/src/h/ST_dtlink_s.java index 8dc4143ad..11d54eae5 100644 --- a/src/h/ST_dtlink_s.java +++ b/src/h/ST_dtlink_s.java @@ -46,7 +46,6 @@ package h; import smetana.core.OFFSET; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.__struct__; @@ -57,7 +56,7 @@ public class ST_dtlink_s extends UnsupportedStructAndPtr implements WithParent { public ST_dtlink_s right; public ST_dtlink_s _left; private final StarStruct parent; - + @Override public void copyDataFrom(__struct__ other) { ST_dtlink_s this2 = (ST_dtlink_s) other; @@ -77,27 +76,27 @@ public class ST_dtlink_s extends UnsupportedStructAndPtr implements WithParent { return parent; } -// @Override -// public __ptr__ castTo(Class dest) { -// if (dest == ST_dtlink_s.class) { -// // return amp(); -// return this; -// } -// if (dest == _dthold_s.class) { -// return new LinkTo_dthold_s(); -// } -// return super.castTo(dest); -// } - + // @Override + // public __ptr__ castTo(Class dest) { + // if (dest == ST_dtlink_s.class) { + // // return amp(); + // return this; + // } + // if (dest == _dthold_s.class) { + // return new LinkTo_dthold_s(); + // } + // return super.castTo(dest); + // } + @Override public __ptr__ castTo(Class dest) { if (dest == ST_dtlink_s.class) { return this; } -// if (dest == refstr_t.class && getParent() instanceof ST_refstr_t) { -// return (ST_refstr_t) getParent(); -// } - if (dest == _dthold_s.class && getParent() instanceof ST_dthold_s) { + // if (dest == refstr_t.class && getParent() instanceof ST_refstr_t) { + // return (ST_refstr_t) getParent(); + // } + if (dest == ST_dthold_s.class && getParent() instanceof ST_dthold_s) { // System.err.println("ITSME"); // System.err.println("getParent()=" + getParent()); return (ST_dthold_s) getParent(); @@ -107,17 +106,15 @@ public class ST_dtlink_s extends UnsupportedStructAndPtr implements WithParent { return super.castTo(dest); } + public ST_dthold_s castTo_ST_dthold_s() { + if (getParent() instanceof ST_dthold_s) { + return (ST_dthold_s) getParent(); + } + throw new UnsupportedOperationException(); + } class LinkTo_dthold_s extends UnsupportedStructAndPtr { - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("obj")) { - return new LinkTo_Obj(); - } - return super.getPtr(fieldName); - } - } class LinkTo_Obj extends UnsupportedStructAndPtr { @@ -163,30 +160,29 @@ public class ST_dtlink_s extends UnsupportedStructAndPtr implements WithParent { return super.addVirtualBytes(virtualBytes); } + // @Override + // public __ptr__ setPtr(String fieldName, __ptr__ newData) { + // if (fieldName.equals("hl._left")) { + // this._left = (ST_dtlink_s) newData; + // return _left; + // } + // if (fieldName.equals("right")) { + // this.right = (ST_dtlink_s) newData; + // return right; + // } + // return super.setPtr(fieldName, newData); + // } -// @Override -// public __ptr__ setPtr(String fieldName, __ptr__ newData) { -// if (fieldName.equals("hl._left")) { -// this._left = (ST_dtlink_s) newData; -// return _left; -// } -// if (fieldName.equals("right")) { -// this.right = (ST_dtlink_s) newData; -// return right; -// } -// return super.setPtr(fieldName, newData); -// } - -// @Override -// public __ptr__ getPtr(String fieldName) { -//// if (fieldName.equals("hl._left")) { -//// return _left; -//// } -// if (fieldName.equals("right")) { -// return right; -// } -// return super.getPtr(fieldName); -// } + // @Override + // public __ptr__ getPtr(String fieldName) { + // // if (fieldName.equals("hl._left")) { + // // return _left; + // // } + // if (fieldName.equals("right")) { + // return right; + // } + // return super.getPtr(fieldName); + // } // public interface ST_dtlink_s extends __ptr__ { // public static List DEFINITION = Arrays.asList( diff --git a/src/h/ST_dtmethod_s.java b/src/h/ST_dtmethod_s.java index a71110bc1..cb52c07d9 100644 --- a/src/h/ST_dtmethod_s.java +++ b/src/h/ST_dtmethod_s.java @@ -46,10 +46,8 @@ package h; import smetana.core.CFunction; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; -import smetana.core.amiga.StarStruct; public class ST_dtmethod_s extends UnsupportedStructAndPtr { @@ -70,28 +68,4 @@ public class ST_dtmethod_s extends UnsupportedStructAndPtr { return result; } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("type")) { - return type; - } - return super.getInt(fieldName); - } - - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("searchf")) { - return searchf; - } - return super.getPtr(fieldName); - } - - @Override - public Object call(String fieldName, Object... args) { - if (fieldName.equals("searchf")) { - return searchf.exe(args); - } - return super.call(fieldName, args); - } - } \ No newline at end of file diff --git a/src/h/ST_fontinfo.java b/src/h/ST_fontinfo.java index 68f2df54e..cdc728a89 100644 --- a/src/h/ST_fontinfo.java +++ b/src/h/ST_fontinfo.java @@ -46,7 +46,6 @@ package h; import smetana.core.CString; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.amiga.StarStruct; @@ -71,14 +70,6 @@ public class ST_fontinfo extends UnsupportedStructAndPtr { // "}"); - @Override - public double getDouble(String fieldName) { - if (fieldName.equals("fontsize")) { - return this.fontsize; - } - return super.getDouble(fieldName); - } - @Override public void setDouble(String fieldName, double data) { if (fieldName.equals("fontsize")) { @@ -88,27 +79,6 @@ public class ST_fontinfo extends UnsupportedStructAndPtr { super.setDouble(fieldName, data); } - @Override - public CString getCString(String fieldName) { - if (fieldName.equals("fontname")) { - return this.fontname; - } - if (fieldName.equals("fontcolor")) { - return this.fontcolor; - } - return super.getCString(fieldName); - } - - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("fontname")) { - return this.fontname; - } - if (fieldName.equals("fontcolor")) { - return this.fontcolor; - } - return super.getPtr(fieldName); - } @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { diff --git a/src/h/ST_gvlayout_engine_s.java b/src/h/ST_gvlayout_engine_s.java index 3dfa4aea6..97b671329 100644 --- a/src/h/ST_gvlayout_engine_s.java +++ b/src/h/ST_gvlayout_engine_s.java @@ -46,15 +46,13 @@ package h; import smetana.core.CFunction; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; -import smetana.core.amiga.StarStruct; public class ST_gvlayout_engine_s extends UnsupportedStructAndPtr { - private CFunction layout; - private CFunction cleanup; + public CFunction layout; + public CFunction cleanup; // "struct gvlayout_engine_s", // "{", @@ -75,27 +73,6 @@ public class ST_gvlayout_engine_s extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("layout")) { - return layout; - } - if (fieldName.equals("cleanup")) { - return cleanup; - } - return super.getPtr(fieldName); - } - - @Override - public Object call(String fieldName, Object... args) { - if (fieldName.equals("layout")) { - return layout.exe(args); - } - if (fieldName.equals("cleanup")) { - return cleanup.exe(args); - } - return super.call(fieldName, args); - } } diff --git a/src/h/ST_gvlayout_features_t.java b/src/h/ST_gvlayout_features_t.java index 4c02ebdef..7d744e6e3 100644 --- a/src/h/ST_gvlayout_features_t.java +++ b/src/h/ST_gvlayout_features_t.java @@ -65,13 +65,6 @@ public class ST_gvlayout_features_t extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("flags")) { - return flags; - } - return super.getInt(fieldName); - } } diff --git a/src/h/ST_gvplugin_active_layout_t.java b/src/h/ST_gvplugin_active_layout_t.java index 39843384b..421a620c8 100644 --- a/src/h/ST_gvplugin_active_layout_t.java +++ b/src/h/ST_gvplugin_active_layout_t.java @@ -51,10 +51,10 @@ import smetana.core.__ptr__; public class ST_gvplugin_active_layout_t extends UnsupportedStructAndPtr { - private ST_gvlayout_engine_s engine; + public ST_gvlayout_engine_s engine; private int id; - private ST_gvlayout_features_t features; - private CString type; + public ST_gvlayout_features_t features; + public CString type; // "}", @@ -75,17 +75,6 @@ public class ST_gvplugin_active_layout_t extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("engine")) { - return engine; - } - if (fieldName.equals("features")) { - return features; - } - return super.getPtr(fieldName); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("id")) { diff --git a/src/h/ST_gvplugin_available_s.java b/src/h/ST_gvplugin_available_s.java index 1e52aec0f..5923bec69 100644 --- a/src/h/ST_gvplugin_available_s.java +++ b/src/h/ST_gvplugin_available_s.java @@ -45,7 +45,6 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.amiga.StarStruct; diff --git a/src/h/ST_gvplugin_installed_t.java b/src/h/ST_gvplugin_installed_t.java index cc2be01f0..0fac04bcd 100644 --- a/src/h/ST_gvplugin_installed_t.java +++ b/src/h/ST_gvplugin_installed_t.java @@ -62,12 +62,12 @@ public class ST_gvplugin_installed_t extends UnsupportedStructAndPtr { this.parent = parent; } - private int id; - private CString type; - private int quality; + public int id; + public CString type; + public int quality; - private ST_gvlayout_engine_s engine; - private ST_gvlayout_features_t features; + public ST_gvlayout_engine_s engine; + public ST_gvlayout_features_t features; @Override public void setInt(String fieldName, int data) { @@ -82,13 +82,6 @@ public class ST_gvplugin_installed_t extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("id")) { - return this.id; - } - return super.getInt(fieldName); - } @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { @@ -107,20 +100,6 @@ public class ST_gvplugin_installed_t extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("type")) { - return type; - } - if (fieldName.equals("engine")) { - return engine; - } - if (fieldName.equals("features")) { - return features; - } - return super.getPtr(fieldName); - } - } // typedef struct { diff --git a/src/h/ST_inside_t.java b/src/h/ST_inside_t.java index bc4276e4b..ee6e44edf 100644 --- a/src/h/ST_inside_t.java +++ b/src/h/ST_inside_t.java @@ -67,16 +67,16 @@ public class ST_inside_t extends UnsupportedStructAndPtr { // "struct", // "{", // "pointf* p", - private ST_pointf.Array p; - private MutableDoublePtr r; + public ST_pointf.Array a_p; + public MutableDoublePtr a_r; // "double* r", // "}", // "a", // "struct", // "{", // "node_t* n", - private ST_Agnode_s n; - private ST_boxf bp; + public ST_Agnode_s s_n; + public ST_boxf s_bp; // "boxf* bp", // "}", @@ -88,40 +88,24 @@ public class ST_inside_t extends UnsupportedStructAndPtr { @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { if (fieldName.equals("s.n")) { - this.n = (ST_Agnode_s) newData; - return this.n; + this.s_n = (ST_Agnode_s) newData; + return this.s_n; } if (fieldName.equals("s.bp")) { - this.bp = (ST_boxf) newData; - return this.bp; + this.s_bp = (ST_boxf) newData; + return this.s_bp; } if (fieldName.equals("a.p")) { - this.p = (ST_pointf.Array) newData; - return this.p; + this.a_p = (ST_pointf.Array) newData; + return this.a_p; } if (fieldName.equals("a.r")) { - this.r = (MutableDoublePtr) newData; - return this.r; + this.a_r = (MutableDoublePtr) newData; + return this.a_r; } return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("s.n")) { - return this.n; - } - if (fieldName.equals("s.bp")) { - return this.bp; - } - if (fieldName.equals("a.p")) { - return this.p; - } - if (fieldName.equals("a.r")) { - return this.r; - } - return super.getPtr(fieldName); - } } diff --git a/src/h/ST_label_params_t.java b/src/h/ST_label_params_t.java index 2d9a5e1ac..ea3c85924 100644 --- a/src/h/ST_label_params_t.java +++ b/src/h/ST_label_params_t.java @@ -45,7 +45,6 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__struct__; import smetana.core.amiga.StarStruct; @@ -79,31 +78,6 @@ public class ST_label_params_t extends UnsupportedStructAndPtr { super.setStruct(fieldName, newData); } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("bb")) { - return bb; - } - return super.getStruct(fieldName); - } - - - @Override - public boolean getBoolean(String fieldName) { - if (fieldName.equals("force")) { - return this.force; - } - return super.getBoolean(fieldName); - } - - @Override - public void setBoolean(String fieldName, boolean data) { - if (fieldName.equals("force")) { - this.force = data; - return; - } - super.setBoolean(fieldName, data); - } } // typedef struct { diff --git a/src/h/ST_layout_t.java b/src/h/ST_layout_t.java index 382af0c1c..74878d5d2 100644 --- a/src/h/ST_layout_t.java +++ b/src/h/ST_layout_t.java @@ -45,10 +45,8 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; -import smetana.core.__struct__; import smetana.core.amiga.StarStruct; public class ST_layout_t extends UnsupportedStructAndPtr { @@ -89,54 +87,6 @@ public class ST_layout_t extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("margin")) { - return margin; - } - if (fieldName.equals("page")) { - return page; - } - if (fieldName.equals("size")) { - return size; - } - return super.getStruct(fieldName); - } - - @Override - public void setBoolean(String fieldName, boolean data) { - if (fieldName.equals("filled")) { - this.filled = data; - return; - } - if (fieldName.equals("landscape")) { - this.landscape = data; - return; - } - if (fieldName.equals("centered")) { - this.centered = data; - return; - } - super.setBoolean(fieldName, data); - } - - @Override - public double getDouble(String fieldName) { - if (fieldName.equals("quantum")) { - return this.quantum; - } - if (fieldName.equals("scale")) { - return this.scale; - } - if (fieldName.equals("ratio")) { - return this.ratio; - } - if (fieldName.equals("dpi")) { - return this.dpi; - } - return super.getDouble(fieldName); - } - @Override public void setDouble(String fieldName, double data) { if (fieldName.equals("quantum")) { @@ -158,13 +108,6 @@ public class ST_layout_t extends UnsupportedStructAndPtr { super.setDouble(fieldName, data); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("ratio_kind")) { - return this.ratio_kind; - } - return super.getInt(fieldName); - } } // typedef struct layout_t { diff --git a/src/h/ST_nodequeue.java b/src/h/ST_nodequeue.java index 816869960..78fde72d3 100644 --- a/src/h/ST_nodequeue.java +++ b/src/h/ST_nodequeue.java @@ -45,9 +45,7 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; -import smetana.core.__array_of_ptr__; import smetana.core.__ptr__; import smetana.core.amiga.StarStruct; @@ -95,22 +93,6 @@ public class ST_nodequeue extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("store")) { - return this.store; - } - if (fieldName.equals("tail")) { - return this.tail; - } - if (fieldName.equals("head")) { - return this.head; - } - if (fieldName.equals("limit")) { - return this.limit; - } - return super.getPtr(fieldName); - } } // typedef struct nodequeue { diff --git a/src/h/ST_object_t.java b/src/h/ST_object_t.java index 6a73f897c..a8a55accf 100644 --- a/src/h/ST_object_t.java +++ b/src/h/ST_object_t.java @@ -48,9 +48,7 @@ package h; import java.util.ArrayList; import java.util.List; -import smetana.core.CString; import smetana.core.UnsupportedArrayOfStruct2; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__array_of_ptr__; import smetana.core.__ptr__; @@ -58,7 +56,7 @@ import smetana.core.__struct__; import smetana.core.size_t; import smetana.core.amiga.StarStruct; -public class ST_object_t extends UnsupportedStructAndPtr { +public class ST_object_t extends UnsupportedStructAndPtr implements ST_Node_t___or_object_t { private final StarStruct parent; @@ -111,10 +109,6 @@ public class ST_object_t extends UnsupportedStructAndPtr { return get(0); } - @Override - public __ptr__ getPtr(String fieldName) { - return get(0).getPtr(fieldName); - } @Override public __ptr__ setPtr(String fieldName, __ptr__ data) { @@ -126,11 +120,6 @@ public class ST_object_t extends UnsupportedStructAndPtr { get(0).setStruct(fieldName, data); } - @Override - public __struct__ getStruct(String fieldName) { - return get(0).getStruct(fieldName); - } - public Array(int size) { this.data = new ArrayList(); this.pos = 0; @@ -182,13 +171,6 @@ public class ST_object_t extends UnsupportedStructAndPtr { throw new UnsupportedOperationException(getClass().toString()); } - public CString getCString() { - throw new UnsupportedOperationException(getClass().toString()); - } - - public void setCString(CString value) { - throw new UnsupportedOperationException(getClass().toString()); - } } @@ -205,17 +187,6 @@ public class ST_object_t extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("pos")) { - return this.pos; - } - if (fieldName.equals("sz")) { - return this.sz; - } - return super.getStruct(fieldName); - } - @Override public void setStruct(String fieldName, __struct__ newData) { if (fieldName.equals("pos")) { @@ -229,20 +200,6 @@ public class ST_object_t extends UnsupportedStructAndPtr { super.setStruct(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("pos")) { - return this.pos; - } - if (fieldName.equals("sz")) { - return this.sz; - } - if (fieldName.equals("lbl")) { - return this.lbl; - } - return super.getPtr(fieldName); - } - } // typedef struct { diff --git a/src/h/ST_pack_info.java b/src/h/ST_pack_info.java index 152029de2..aafed5f36 100644 --- a/src/h/ST_pack_info.java +++ b/src/h/ST_pack_info.java @@ -45,7 +45,6 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.amiga.StarStruct; @@ -65,37 +64,20 @@ public class ST_pack_info extends UnsupportedStructAndPtr { // "typedef struct", // "{", // "float aspect", - private int sz; - private int margin; + public int sz; + public int margin; private int doSplines; // "pack_mode mode", - private int mode; + public int mode; private __ptr__ fixed; // "boolean *fixed", // "packval_t* vals", - private __ptr__ vals; - private int flags; + public __ptr__ vals; + public int flags; // "}", // "pack_info"); - @Override - public int getInt(String fieldName) { - if (fieldName.equals("flags")) { - return this.flags; - } - if (fieldName.equals("mode")) { - return this.mode; - } - if (fieldName.equals("sz")) { - return this.sz; - } - if (fieldName.equals("margin")) { - return this.margin; - } - return super.getInt(fieldName); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("flags")) { diff --git a/src/h/ST_path.java b/src/h/ST_path.java index 488ad92f1..5e4c8b88d 100644 --- a/src/h/ST_path.java +++ b/src/h/ST_path.java @@ -47,7 +47,6 @@ package h; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; -import smetana.core.__struct__; import smetana.core.amiga.StarStruct; public class ST_path extends UnsupportedStructAndPtr { @@ -84,42 +83,6 @@ public class ST_path extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("data")) { - return this.data; - } - return super.getPtr(fieldName); - } - - @Override - public ST_port getStruct(String fieldName) { - if (fieldName.equals("start")) { - return start; - } - if (fieldName.equals("end")) { - return end; - } - throw new UnsupportedOperationException(); - } - - @Override - public int getInt(String fieldName) { - if (fieldName.equals("nbox")) { - return this.nbox; - } - return super.getInt(fieldName); - } - - @Override - public void setInt(String fieldName, int data) { - if (fieldName.equals("nbox")) { - this.nbox = data; - return; - } - super.setInt(fieldName, data); - } - } // typedef struct path { /* internal specification for an edge spline */ diff --git a/src/h/ST_pathend_t.java b/src/h/ST_pathend_t.java index baaabd75f..0a1f172e7 100644 --- a/src/h/ST_pathend_t.java +++ b/src/h/ST_pathend_t.java @@ -45,7 +45,6 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.__struct__; @@ -97,28 +96,6 @@ public class ST_pathend_t extends UnsupportedStructAndPtr { super.setStruct(fieldName, newData); } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("nb")) { - return this.nb; - } - if (fieldName.equals("np")) { - return this.np; - } - return super.getStruct(fieldName); - } - - @Override - public int getInt(String fieldName) { - if (fieldName.equals("boxn")) { - return this.boxn; - } - if (fieldName.equals("sidemask")) { - return this.sidemask; - } - return super.getInt(fieldName); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("boxn")) { diff --git a/src/h/ST_point.java b/src/h/ST_point.java index 9a599b0da..f450411a0 100644 --- a/src/h/ST_point.java +++ b/src/h/ST_point.java @@ -45,7 +45,6 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__struct__; import smetana.core.amiga.StarStruct; @@ -85,17 +84,6 @@ public class ST_point extends UnsupportedStructAndPtr { this.y = this2.y; } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("x")) { - return this.x; - } - if (fieldName.equals("y")) { - return this.y; - } - return super.getInt(fieldName); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("x")) { diff --git a/src/h/ST_pointf.java b/src/h/ST_pointf.java index ca53bc689..9f36f0a6d 100644 --- a/src/h/ST_pointf.java +++ b/src/h/ST_pointf.java @@ -85,11 +85,6 @@ public class ST_pointf extends UnsupportedStructAndPtr implements HardcodedStruc return this; } - @Override - public double getDouble(String fieldName) { - return getStruct().getDouble(fieldName); - } - @Override public void setDouble(String fieldName, double value) { getStruct().setDouble(fieldName, value); @@ -156,10 +151,6 @@ public class ST_pointf extends UnsupportedStructAndPtr implements HardcodedStruc throw new UnsupportedOperationException(getClass().toString()); } - public CString getCString() { - throw new UnsupportedOperationException(getClass().toString()); - } - public void setCString(CString value) { throw new UnsupportedOperationException(getClass().toString()); } @@ -282,17 +273,6 @@ public class ST_pointf extends UnsupportedStructAndPtr implements HardcodedStruc this.y = other2.y; } - @Override - public double getDouble(String fieldName) { - if (fieldName.equals("x")) { - return x; - } - if (fieldName.equals("y")) { - return y; - } - return super.getDouble(fieldName); - } - @Override public void setDouble(String fieldName, double data) { if (fieldName.equals("x")) { diff --git a/src/h/ST_pointnlink_t.java b/src/h/ST_pointnlink_t.java index 936ddeb90..c8a9d5767 100644 --- a/src/h/ST_pointnlink_t.java +++ b/src/h/ST_pointnlink_t.java @@ -68,18 +68,6 @@ public class ST_pointnlink_t extends UnsupportedStructAndPtr implements Hardcode return this == other2; } - - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("pp")) { - return pp; - } - if (fieldName.equals("link")) { - return link; - } - return super.getPtr(fieldName); - } - @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { if (fieldName.equals("pp")) { diff --git a/src/h/ST_polygon_t.java b/src/h/ST_polygon_t.java index 0d554689c..89cf65d25 100644 --- a/src/h/ST_polygon_t.java +++ b/src/h/ST_polygon_t.java @@ -46,9 +46,7 @@ package h; import smetana.core.HardcodedStruct; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; -import smetana.core.__ptr__; import smetana.core.amiga.StarStruct; public class ST_polygon_t extends UnsupportedStructAndPtr implements HardcodedStruct { @@ -71,43 +69,7 @@ public class ST_polygon_t extends UnsupportedStructAndPtr implements HardcodedSt public ST_polygon_t(StarStruct parent) { } - @Override - public boolean getBoolean(String fieldName) { - if (fieldName.equals("regular")) { - return regular != 0; - } - return super.getBoolean(fieldName); - } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("option")) { - return option; - } - if (fieldName.equals("sides")) { - return sides; - } - if (fieldName.equals("peripheries")) { - return peripheries; - } - return super.getInt(fieldName); - } - - - - @Override - public double getDouble(String fieldName) { - if (fieldName.equals("orientation")) { - return orientation; - } - if (fieldName.equals("skew")) { - return skew; - } - if (fieldName.equals("distortion")) { - return distortion; - } - return super.getDouble(fieldName); - } @Override public void setInt(String fieldName, int data) { diff --git a/src/h/ST_port.java b/src/h/ST_port.java index 973274c34..36092cf17 100644 --- a/src/h/ST_port.java +++ b/src/h/ST_port.java @@ -133,14 +133,6 @@ public class ST_port extends UnsupportedStructAndPtr implements HardcodedStruct return result; } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("p")) { - return p; - } - return super.getStruct(fieldName); - } - @Override public void setStruct(String fieldName, __struct__ newData) { if (fieldName.equals("p")) { @@ -150,26 +142,6 @@ public class ST_port extends UnsupportedStructAndPtr implements HardcodedStruct super.setStruct(fieldName, newData); } - @Override - public boolean getBoolean(String fieldName) { - if (fieldName.equals("constrained")) { - return constrained != 0; - } - if (fieldName.equals("dyna")) { - return dyna != 0; - } - return super.getBoolean(fieldName); - } - - @Override - public void setBoolean(String fieldName, boolean data) { - if (fieldName.equals("constrained")) { - constrained = data ? 1 : 0; - return; - } - super.setBoolean(fieldName, data); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("constrained")) { @@ -179,27 +151,6 @@ public class ST_port extends UnsupportedStructAndPtr implements HardcodedStruct super.setInt(fieldName, data); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("clip")) { - return clip; - } - if (fieldName.equals("order")) { - return order; - } - if (fieldName.equals("side")) { - return side; - } - return super.getInt(fieldName); - } - - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("bp")) { - return bp; - } - return super.getPtr(fieldName); - } @Override public void setDouble(String fieldName, double data) { @@ -210,14 +161,6 @@ public class ST_port extends UnsupportedStructAndPtr implements HardcodedStruct super.setDouble(fieldName, data); } - @Override - public double getDouble(String fieldName) { - if (fieldName.equals("theta")) { - return theta; - } - return super.getDouble(fieldName); - } - // "typedef struct port", // "{", // "pointf p", diff --git a/src/h/ST_rank_t.java b/src/h/ST_rank_t.java index 29df5014d..1f33609e2 100644 --- a/src/h/ST_rank_t.java +++ b/src/h/ST_rank_t.java @@ -49,7 +49,6 @@ import java.util.ArrayList; import java.util.List; import smetana.core.UnsupportedArrayOfPtr; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__array_of_ptr__; import smetana.core.__ptr__; @@ -111,36 +110,15 @@ public class ST_rank_t extends UnsupportedStructAndPtr { return getPtr().setPtr(fieldName, newData); } - @Override - public __ptr__ getPtr(String fieldName) { - return getPtr().getPtr(fieldName); - } - - @Override - public boolean getBoolean(String fieldName) { - return getPtr().getBoolean(fieldName); - } - - @Override - public void setBoolean(String fieldName, boolean data) { - getPtr().setBoolean(fieldName, data); - } - - @Override - public int getInt(String fieldName) { - return getPtr().getInt(fieldName); - } - - @Override - public double getDouble(String fieldName) { - return getPtr().getDouble(fieldName); - } - @Override public void setDouble(String fieldName, double data) { getPtr().setDouble(fieldName, data); } + public ST_rank_t get(int i) { + return plus(i).getPtr(); + } + public void swap(int i, int j) { ST_rank_t e1 = data.get(i); ST_rank_t e2 = data.get(j); @@ -219,47 +197,6 @@ public class ST_rank_t extends UnsupportedStructAndPtr { } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("n")) { - return n; - } - if (fieldName.equals("an")) { - return an; - } - if (fieldName.equals("cache_nc")) { - return cache_nc; - } - return super.getInt(fieldName); - } - - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("v")) { - return v; - } - if (fieldName.equals("av")) { - return av; - } - if (fieldName.equals("flat")) { - return flat; - } - return super.getPtr(fieldName); - } - - @Override - public void setBoolean(String fieldName, boolean data) { - if (fieldName.equals("candidate")) { - this.candidate = data; - return; - } - if (fieldName.equals("valid")) { - this.valid = data ? 1 : 0; - return; - } - super.setBoolean(fieldName, data); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("n")) { @@ -281,34 +218,6 @@ public class ST_rank_t extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public boolean getBoolean(String fieldName) { - if (fieldName.equals("valid")) { - return valid != 0; - } - if (fieldName.equals("candidate")) { - return candidate; - } - return super.getBoolean(fieldName); - } - - @Override - public double getDouble(String fieldName) { - if (fieldName.equals("pht1")) { - return pht1; - } - if (fieldName.equals("pht2")) { - return pht2; - } - if (fieldName.equals("ht1")) { - return ht1; - } - if (fieldName.equals("ht2")) { - return ht2; - } - return super.getDouble(fieldName); - } - @Override public void setDouble(String fieldName, double data) { if (fieldName.equals("pht1")) { diff --git a/src/h/ST_shape_desc.java b/src/h/ST_shape_desc.java index 00dbcda2e..b4de2dfc8 100644 --- a/src/h/ST_shape_desc.java +++ b/src/h/ST_shape_desc.java @@ -82,33 +82,6 @@ public class ST_shape_desc extends UnsupportedStructAndPtr implements HardcodedS return super.setPtr(fieldName, newData); } - @Override - public CString getCString(String fieldName) { - if (fieldName.equals("name")) { - return name; - } - return super.getCString(fieldName); - } - - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("fns")) { - return fns; - } - if (fieldName.equals("polygon")) { - return polygon; - } - return super.getPtr(fieldName); - } - - @Override - public boolean getBoolean(String fieldName) { - if (fieldName.equals("usershape")) { - return usershape; - } - return super.getBoolean(fieldName); - } - // public static List DEFINITION = Arrays.asList( // "typedef struct shape_desc", // "{", diff --git a/src/h/ST_shape_functions.java b/src/h/ST_shape_functions.java index 105556537..3efa33245 100644 --- a/src/h/ST_shape_functions.java +++ b/src/h/ST_shape_functions.java @@ -46,7 +46,6 @@ package h; import smetana.core.CFunction; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.amiga.StarStruct; @@ -67,35 +66,6 @@ public class ST_shape_functions extends UnsupportedStructAndPtr { public ST_shape_functions(StarStruct parent) { } - - @Override - public Object call(String fieldName, Object... args) { - return ((CFunction) getPtr(fieldName)).exe(args); - } - - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("initfn")) { - return initfn; - } - if (fieldName.equals("freefn")) { - return freefn; - } - if (fieldName.equals("portfn")) { - return portfn; - } - if (fieldName.equals("insidefn")) { - return insidefn; - } - if (fieldName.equals("pboxfn")) { - return pboxfn; - } - if (fieldName.equals("codefn")) { - return codefn; - } - return super.getPtr(fieldName); - } - @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { if (fieldName.equals("initfn")) { diff --git a/src/h/ST_splineInfo.java b/src/h/ST_splineInfo.java index c635b8bf1..4ae18c3f9 100644 --- a/src/h/ST_splineInfo.java +++ b/src/h/ST_splineInfo.java @@ -46,7 +46,6 @@ package h; import smetana.core.CFunction; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.amiga.StarStruct; @@ -78,28 +77,6 @@ public class ST_splineInfo extends UnsupportedStructAndPtr { return super.setPtr(fieldName, newData); } - @Override - public Object call(String fieldName, Object... args) { - if (fieldName.equals("swapEnds")) { - return swapEnds.exe(args); - } - if (fieldName.equals("splineMerge")) { - return splineMerge.exe(args); - } - return super.call(fieldName, args); - } - - @Override - public boolean getBoolean(String fieldName) { - if (fieldName.equals("ignoreSwap")) { - return ignoreSwap; - } - if (fieldName.equals("isOrtho")) { - return isOrtho; - } - return super.getBoolean(fieldName); - } - // public interface ST_splineInfo extends __ptr__ { // public static List DEFINITION = Arrays.asList( // "typedef struct", diff --git a/src/h/ST_spline_info_t.java b/src/h/ST_spline_info_t.java index e80a4484e..3e2e221b5 100644 --- a/src/h/ST_spline_info_t.java +++ b/src/h/ST_spline_info_t.java @@ -45,9 +45,7 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; -import smetana.core.__ptr__; import smetana.core.amiga.StarStruct; public class ST_spline_info_t extends UnsupportedStructAndPtr { @@ -70,23 +68,6 @@ public class ST_spline_info_t extends UnsupportedStructAndPtr { // "}", // "spline_info_t"); - @Override - public int getInt(String fieldName) { - if (fieldName.equals("LeftBound")) { - return this.LeftBound; - } - if (fieldName.equals("RightBound")) { - return this.RightBound; - } - if (fieldName.equals("Splinesep")) { - return this.Splinesep; - } - if (fieldName.equals("Multisep")) { - return this.Multisep; - } - return super.getInt(fieldName); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("LeftBound")) { diff --git a/src/h/ST_splines.java b/src/h/ST_splines.java index ebbae7a0e..ee9333031 100644 --- a/src/h/ST_splines.java +++ b/src/h/ST_splines.java @@ -45,9 +45,7 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; -import smetana.core.__array_of_ptr__; import smetana.core.amiga.StarStruct; public class ST_splines extends UnsupportedStructAndPtr { @@ -81,14 +79,6 @@ public class ST_splines extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("size")) { - return this.size; - } - return super.getInt(fieldName); - } - } // typedef struct splines { diff --git a/src/h/ST_tedge_t.java b/src/h/ST_tedge_t.java index 8a157dd88..e646dc7f0 100644 --- a/src/h/ST_tedge_t.java +++ b/src/h/ST_tedge_t.java @@ -45,7 +45,6 @@ */ package h; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.amiga.StarStruct; @@ -78,16 +77,6 @@ public class ST_tedge_t extends UnsupportedStructAndPtr { // "}", // "tedge_t"); - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("pnl0p")) { - return this.pnl0p; - } - if (fieldName.equals("pnl1p")) { - return this.pnl1p; - } - return super.getPtr(fieldName); - } @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { diff --git a/src/h/ST_textlabel_t.java b/src/h/ST_textlabel_t.java index 3f51b797c..069749e28 100644 --- a/src/h/ST_textlabel_t.java +++ b/src/h/ST_textlabel_t.java @@ -46,7 +46,6 @@ package h; import smetana.core.CString; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__ptr__; import smetana.core.__struct__; @@ -77,7 +76,7 @@ public class ST_textlabel_t extends UnsupportedStructAndPtr { // "struct", // "{", // private ST_textspan_t span; - public __ptr__ span; + public ST_textspan_t.Array span; public int nspans; // "}", @@ -95,20 +94,6 @@ public class ST_textlabel_t extends UnsupportedStructAndPtr { // "}", // "textlabel_t"); - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("dimen")) { - return dimen; - } - if (fieldName.equals("space")) { - return space; - } - if (fieldName.equals("pos")) { - return pos; - } - return super.getStruct(fieldName); - } - @Override public void setStruct(String fieldName, __struct__ newData) { if (fieldName.equals("space")) { @@ -137,34 +122,12 @@ public class ST_textlabel_t extends UnsupportedStructAndPtr { return fontcolor; } if (fieldName.equals("u.txt.span")) { - this.span = newData; + this.span = (ST_textspan_t.Array) newData; return span; } return super.setPtr(fieldName, newData); } - @Override - public CString getCString(String fieldName) { - if (fieldName.equals("text")) { - return text; - } - return super.getCString(fieldName); - } - - @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("text")) { - return text; - } - if (fieldName.equals("u.txt.span")) { - return span; - } - if (fieldName.equals("fontname")) { - return fontname; - } - return super.getPtr(fieldName); - } - @Override public void setDouble(String fieldName, double data) { if (fieldName.equals("fontsize")) { @@ -174,14 +137,6 @@ public class ST_textlabel_t extends UnsupportedStructAndPtr { super.setDouble(fieldName, data); } - @Override - public double getDouble(String fieldName) { - if (fieldName.equals("fontsize")) { - return this.fontsize; - } - return super.getDouble(fieldName); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("charset")) { @@ -203,15 +158,6 @@ public class ST_textlabel_t extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public void setBoolean(String fieldName, boolean data) { - if (fieldName.equals("set")) { - this.set = data ? 1 : 0; - return; - } - super.setBoolean(fieldName, data); - } - @Override public boolean isSameThan(StarStruct other) { ST_textlabel_t other2 = (ST_textlabel_t) other; @@ -219,23 +165,6 @@ public class ST_textlabel_t extends UnsupportedStructAndPtr { } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("charset")) { - return this.charset; - } - if (fieldName.equals("valign")) { - return this.valign; - } - if (fieldName.equals("u.txt.nspans")) { - return this.nspans; - } - if (fieldName.equals("set")) { - return this.set; - } - return super.getInt(fieldName); - } - } // typedef struct textlabel_t { diff --git a/src/h/ST_textspan_t.java b/src/h/ST_textspan_t.java index 5e4a977a6..dcf4a3985 100644 --- a/src/h/ST_textspan_t.java +++ b/src/h/ST_textspan_t.java @@ -50,7 +50,6 @@ import java.util.List; import smetana.core.CString; import smetana.core.UnsupportedArrayOfStruct2; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__array_of_ptr__; import smetana.core.__ptr__; @@ -100,11 +99,6 @@ public class ST_textspan_t extends UnsupportedStructAndPtr { getStruct().setStruct(fieldName, data); } - @Override - public __struct__ getStruct(String fieldName) { - return getStruct().getStruct(fieldName); - } - @Override public Array asPtr() { return this; @@ -166,25 +160,10 @@ public class ST_textspan_t extends UnsupportedStructAndPtr { throw new UnsupportedOperationException(getClass().toString()); } - public CString getCString() { - throw new UnsupportedOperationException(getClass().toString()); - } - - public void setCString(CString value) { - throw new UnsupportedOperationException(getClass().toString()); - } } - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("size")) { - return size; - } - return super.getStruct(fieldName); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("just")) { @@ -194,14 +173,6 @@ public class ST_textspan_t extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("just")) { - return this.just; - } - return super.getInt(fieldName); - } - @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { if (fieldName.equals("str")) { diff --git a/src/h/ST_tna_t.java b/src/h/ST_tna_t.java index 60ff37bbd..9d75f9da8 100644 --- a/src/h/ST_tna_t.java +++ b/src/h/ST_tna_t.java @@ -48,9 +48,7 @@ package h; import java.util.ArrayList; import java.util.List; -import smetana.core.CString; import smetana.core.UnsupportedArrayOfStruct2; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__array_of_ptr__; import smetana.core.__ptr__; @@ -94,11 +92,6 @@ public class ST_tna_t extends UnsupportedStructAndPtr { return data.get(pos); } - @Override - public double getDouble(String fieldName) { - return getStruct().getDouble(fieldName); - } - public Array(int size) { this.data = new ArrayList(); this.pos = 0; @@ -150,26 +143,10 @@ public class ST_tna_t extends UnsupportedStructAndPtr { throw new UnsupportedOperationException(getClass().toString()); } - public CString getCString() { - throw new UnsupportedOperationException(getClass().toString()); - } - - public void setCString(CString value) { - throw new UnsupportedOperationException(getClass().toString()); - } } - - @Override - public double getDouble(String fieldName) { - if (fieldName.equals("t")) { - return this.t; - } - return super.getDouble(fieldName); - } - @Override public void setDouble(String fieldName, double data) { if (fieldName.equals("t")) { diff --git a/src/h/ST_triangle_t.java b/src/h/ST_triangle_t.java index 1ddcf34f8..248b2a44e 100644 --- a/src/h/ST_triangle_t.java +++ b/src/h/ST_triangle_t.java @@ -48,9 +48,7 @@ package h; import java.util.ArrayList; import java.util.List; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; -import smetana.core.__ptr__; import smetana.core.amiga.StarStruct; public class ST_triangle_t extends UnsupportedStructAndPtr { @@ -117,14 +115,6 @@ public class ST_triangle_t extends UnsupportedStructAndPtr { // "}", // "triangle_t"); - @Override - public int getInt(String fieldName) { - if (fieldName.equals("mark")) { - return this.mark; - } - return super.getInt(fieldName); - } - @Override public void setInt(String fieldName, int data) { if (fieldName.equals("mark")) { @@ -134,14 +124,6 @@ public class ST_triangle_t extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public boolean getBoolean(String fieldName) { - if (fieldName.equals("mark")) { - return this.mark != 0; - } - return super.getBoolean(fieldName); - } - } // typedef struct triangle_t { diff --git a/src/h/ST_xlabel_t.java b/src/h/ST_xlabel_t.java index 0854074ec..ffaee089d 100644 --- a/src/h/ST_xlabel_t.java +++ b/src/h/ST_xlabel_t.java @@ -48,9 +48,7 @@ package h; import java.util.ArrayList; import java.util.List; -import smetana.core.CString; import smetana.core.UnsupportedArrayOfStruct2; -import smetana.core.UnsupportedStarStruct; import smetana.core.UnsupportedStructAndPtr; import smetana.core.__array_of_ptr__; import smetana.core.__ptr__; @@ -88,31 +86,11 @@ public class ST_xlabel_t extends UnsupportedStructAndPtr { private final List data; private final int pos_; - @Override - public __struct__ getStruct(String fieldName) { - return get(0).getStruct(fieldName); - } - @Override public void setInt(String fieldName, int data) { get(0).setInt(fieldName, data); } - @Override - public boolean getBoolean(String fieldName) { - return get(0).getBoolean(fieldName); - } - - @Override - public __ptr__ getPtr(String fieldName) { - return get(0).getPtr(fieldName); - } - - @Override - public int getInt(String fieldName) { - return get(0).getInt(fieldName); - } - @Override public void setStruct(__struct__ value) { get(0).___(value); @@ -123,18 +101,13 @@ public class ST_xlabel_t extends UnsupportedStructAndPtr { return this; } - @Override - public double getDouble(String fieldName) { - return get(0).getDouble(fieldName); - } - @Override public void setDouble(String fieldName, double value) { get(0).setDouble(fieldName, value); } @Override - public __struct__ getStruct() { + public ST_xlabel_t getStruct() { return get(0).getStruct(); } @@ -195,13 +168,6 @@ public class ST_xlabel_t extends UnsupportedStructAndPtr { throw new UnsupportedOperationException(getClass().toString()); } - public CString getCString() { - throw new UnsupportedOperationException(getClass().toString()); - } - - public void setCString(CString value) { - throw new UnsupportedOperationException(getClass().toString()); - } } @@ -215,22 +181,6 @@ public class ST_xlabel_t extends UnsupportedStructAndPtr { super.setInt(fieldName, data); } - @Override - public int getInt(String fieldName) { - if (fieldName.equals("set")) { - return this.set; - } - return super.getInt(fieldName); - } - - @Override - public boolean getBoolean(String fieldName) { - if (fieldName.equals("set")) { - return this.set!=0; - } - return super.getBoolean(fieldName); - } - @Override public __ptr__ setPtr(String fieldName, __ptr__ newData) { if (fieldName.equals("lbl")) { @@ -241,22 +191,8 @@ public class ST_xlabel_t extends UnsupportedStructAndPtr { } @Override - public __ptr__ getPtr(String fieldName) { - if (fieldName.equals("lbl")) { - return this.lbl; - } - return super.getPtr(fieldName); - } - - @Override - public __struct__ getStruct(String fieldName) { - if (fieldName.equals("sz")) { - return this.sz; - } - if (fieldName.equals("pos")) { - return this.pos; - } - return super.getStruct(fieldName); + public ST_xlabel_t getStruct() { + return this; } @Override diff --git a/src/h/_dthold_s.java b/src/h/_dthold_s.java deleted file mode 100644 index a33c6253c..000000000 --- a/src/h/_dthold_s.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of Smetana. - * Smetana is a partial translation of Graphviz/Dot sources from C to Java. - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * This translation is distributed under the same Licence as the original C program: - * - ************************************************************************* - * Copyright (c) 2011 AT&T Intellectual Property - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: See CVS logs. Details at http://www.graphviz.org/ - ************************************************************************* - * - * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC - * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0] - * - * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES - * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - * - * You may obtain a copy of the License at - * - * http://www.eclipse.org/legal/epl-v10.html - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package h; -import java.util.Arrays; -import java.util.List; - -import smetana.core.__ptr__; - -//2 bj5vks4vb3mb95f68v6qwe1q - -public interface _dthold_s extends __ptr__ { - public static List DEFINITION = Arrays.asList( -"struct _dthold_s", -"{", -"Dtlink_t hdr", -"void* obj", -"}"); -} - -// struct _dthold_s -// { Dtlink_t hdr; /* header */ -// void* obj; /* user object */ -// }; \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/Annotated.java b/src/net/sourceforge/plantuml/Annotated.java index 7bf7596aa..4201f0d5c 100644 --- a/src/net/sourceforge/plantuml/Annotated.java +++ b/src/net/sourceforge/plantuml/Annotated.java @@ -35,6 +35,7 @@ */ package net.sourceforge.plantuml; +import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.DisplayPositionned; import net.sourceforge.plantuml.cucadiagram.DisplaySection; @@ -50,4 +51,6 @@ public interface Annotated { public DisplaySection getFooter(); + public Display getMainFrame(); + } diff --git a/src/net/sourceforge/plantuml/AnnotatedWorker.java b/src/net/sourceforge/plantuml/AnnotatedWorker.java index 0331b08c2..3911daddb 100644 --- a/src/net/sourceforge/plantuml/AnnotatedWorker.java +++ b/src/net/sourceforge/plantuml/AnnotatedWorker.java @@ -35,35 +35,97 @@ */ package net.sourceforge.plantuml; +import java.awt.geom.Dimension2D; +import java.awt.geom.Rectangle2D; + import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend; +import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.DisplayPositionned; import net.sourceforge.plantuml.cucadiagram.DisplaySection; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; +import net.sourceforge.plantuml.graphic.HtmlColor; +import net.sourceforge.plantuml.graphic.HtmlColorUtils; +import net.sourceforge.plantuml.graphic.InnerStrategy; +import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.graphic.SymbolContext; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; +import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.svek.DecorateEntityImage; import net.sourceforge.plantuml.svek.TextBlockBackcolored; +import net.sourceforge.plantuml.ugraphic.MinMax; +import net.sourceforge.plantuml.ugraphic.UGraphic; +import net.sourceforge.plantuml.ugraphic.UTranslate; public class AnnotatedWorker { private final Annotated annotated; private final ISkinParam skinParam; + private final StringBounder stringBounder; - public AnnotatedWorker(Annotated annotated, ISkinParam skinParam) { + public AnnotatedWorker(Annotated annotated, ISkinParam skinParam, StringBounder stringBounder) { this.annotated = annotated; this.skinParam = skinParam; - + this.stringBounder = stringBounder; } public TextBlockBackcolored addAdd(TextBlock result) { - result = addLegend(result); result = addTitle(result); + result = addFrame(result); + result = addLegend(result); result = addCaption(result); result = addHeaderAndFooter(result); return (TextBlockBackcolored) result; } + public TextBlock addFrame(final TextBlock original) { + final Display mainFrame = annotated.getMainFrame(); + if (mainFrame == null) { + return original; + } + + final double x1 = 5; + final double x2 = 7; + final double y1 = 10; + final double y2 = 10; + + final SymbolContext symbolContext = new SymbolContext(getSkinParam().getBackgroundColor(), HtmlColorUtils.BLACK) + .withShadow(getSkinParam().shadowing(null)); + final TextBlock title = mainFrame.create(new FontConfiguration(getSkinParam(), FontParam.CAPTION, null), + HorizontalAlignment.CENTER, getSkinParam()); + final Dimension2D dimTitle = title.calculateDimension(stringBounder); + final Dimension2D dimOriginal = original.calculateDimension(stringBounder); + final double width = x1 + Math.max(dimOriginal.getWidth(), dimTitle.getWidth()) + x2; + final double height = dimTitle.getHeight() + y1 + dimOriginal.getHeight() + y2; + final TextBlock result = USymbol.FRAME.asBig(title, HorizontalAlignment.LEFT, TextBlockUtils.empty(0, 0), + width, height, symbolContext); + + return new TextBlockBackcolored() { + + public void drawU(UGraphic ug) { + result.drawU(ug); + original.drawU(ug.apply(new UTranslate(x1, y1 + dimTitle.getHeight()))); + } + + public MinMax getMinMax(StringBounder stringBounder) { + return TextBlockUtils.getMinMax(result, stringBounder); + } + + public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) { + return result.getInnerPosition(member, stringBounder, strategy); + } + + public Dimension2D calculateDimension(StringBounder stringBounder) { + return result.calculateDimension(stringBounder); + } + + public HtmlColor getBackcolor() { + return symbolContext.getBackColor(); + } + }; + } + private TextBlock addLegend(TextBlock original) { final DisplayPositionned legend = annotated.getLegend(); if (legend.isNull()) { @@ -117,11 +179,13 @@ public class AnnotatedWorker { } TextBlock textFooter = null; if (footer.isNull() == false) { - textFooter = footer.createRibbon(new FontConfiguration(getSkinParam(), FontParam.FOOTER, null), getSkinParam()); + textFooter = footer.createRibbon(new FontConfiguration(getSkinParam(), FontParam.FOOTER, null), + getSkinParam()); } TextBlock textHeader = null; if (header.isNull() == false) { - textHeader = header.createRibbon(new FontConfiguration(getSkinParam(), FontParam.HEADER, null), getSkinParam()); + textHeader = header.createRibbon(new FontConfiguration(getSkinParam(), FontParam.HEADER, null), + getSkinParam()); } return DecorateEntityImage.addTopAndBottom(original, textHeader, header.getHorizontalAlignment(), textFooter, diff --git a/src/net/sourceforge/plantuml/BackSlash.java b/src/net/sourceforge/plantuml/BackSlash.java index 1985c1939..60308b33e 100644 --- a/src/net/sourceforge/plantuml/BackSlash.java +++ b/src/net/sourceforge/plantuml/BackSlash.java @@ -96,6 +96,10 @@ public class BackSlash { if (s == null) { return null; } + // final String tmps = s.toString(); + // if (tmps.indexOf('\\') == -1) { + // return tmps; + // } final StringBuilder result = new StringBuilder(); for (int i = 0; i < s.length(); i++) { final char c = s.charAt(i); diff --git a/src/net/sourceforge/plantuml/BlockUmlBuilder.java b/src/net/sourceforge/plantuml/BlockUmlBuilder.java index 501718773..c7311b352 100644 --- a/src/net/sourceforge/plantuml/BlockUmlBuilder.java +++ b/src/net/sourceforge/plantuml/BlockUmlBuilder.java @@ -45,6 +45,7 @@ import java.util.List; import java.util.Set; import net.sourceforge.plantuml.preproc.Defines; +import net.sourceforge.plantuml.preproc.DefinesGet; import net.sourceforge.plantuml.preproc.FileWithSuffix; import net.sourceforge.plantuml.preproc.ImportedFiles; import net.sourceforge.plantuml.preproc.ReadLineNumbered; @@ -66,7 +67,6 @@ public final class BlockUmlBuilder implements DefinitionsContainer { this.defines = defines; try { reader2 = new UncommentReadLine(ReadLineReader.create(reader, desc)); - // includer = new Preprocessor(config, reader2, charset, defines, newCurrentDir, this); includer = new Preprocessor2(config, reader2, charset, defines, this, ImportedFiles.createImportedFiles(new AParentFolderRegular(newCurrentDir))); init(includer); diff --git a/src/net/sourceforge/plantuml/ErrorUml.java b/src/net/sourceforge/plantuml/ErrorUml.java index f1e25e4c6..638b1b123 100644 --- a/src/net/sourceforge/plantuml/ErrorUml.java +++ b/src/net/sourceforge/plantuml/ErrorUml.java @@ -44,13 +44,11 @@ public class ErrorUml { private final ErrorUmlType type; private SuggestEngineResult suggest; private final LineLocation lineLocation; -// private final int startLine; public ErrorUml(ErrorUmlType type, String error, LineLocation lineLocation) { - if (error == null || type == null || StringUtils.isEmpty(error)) { + if (error == null || type == null) { throw new IllegalArgumentException(); } -// this.startLine = startLine; this.error = error; this.type = type; this.lineLocation = lineLocation; diff --git a/src/net/sourceforge/plantuml/FontParam.java b/src/net/sourceforge/plantuml/FontParam.java index 2ebfca7f9..d718d2958 100644 --- a/src/net/sourceforge/plantuml/FontParam.java +++ b/src/net/sourceforge/plantuml/FontParam.java @@ -45,6 +45,7 @@ interface FontParamConstant { } public enum FontParam { + TIMING(12, Font.PLAIN), // ACTIVITY(12, Font.PLAIN), // ACTIVITY_DIAMOND(11, Font.PLAIN), // // ACTIVITY_ARROW(11, Font.PLAIN), // @@ -118,8 +119,7 @@ public enum FontParam { STACK_STEREOTYPE(14, Font.ITALIC), // ACTOR_STEREOTYPE(14, Font.ITALIC), // SEQUENCE_STEREOTYPE(14, Font.ITALIC), // - PARTITION(14, Font.PLAIN), - DESIGNED_DOMAIN(12, Font.PLAIN), // + PARTITION(14, Font.PLAIN), DESIGNED_DOMAIN(12, Font.PLAIN), // DESIGNED_DOMAIN_STEREOTYPE(12, Font.ITALIC), // DOMAIN(12, Font.PLAIN), // DOMAIN_STEREOTYPE(12, Font.ITALIC), // diff --git a/src/net/sourceforge/plantuml/ISkinParam.java b/src/net/sourceforge/plantuml/ISkinParam.java index c788b5e40..81730a02d 100644 --- a/src/net/sourceforge/plantuml/ISkinParam.java +++ b/src/net/sourceforge/plantuml/ISkinParam.java @@ -68,7 +68,7 @@ public interface ISkinParam extends ISkinSimple { public UFont getFont(Stereotype stereotype, boolean inPackageTitle, FontParam... fontParam); - public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDirection arrowDirection); + public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDirection arrowDirection, boolean isReverseDefine); public HorizontalAlignment getDefaultTextAlignment(HorizontalAlignment defaultValue); diff --git a/src/net/sourceforge/plantuml/OptionFlags.java b/src/net/sourceforge/plantuml/OptionFlags.java index c0588d42d..1869b4f93 100644 --- a/src/net/sourceforge/plantuml/OptionFlags.java +++ b/src/net/sourceforge/plantuml/OptionFlags.java @@ -87,7 +87,6 @@ public class OptionFlags { } private void reset(boolean exit) { - // keepTmpFiles = false; verbose = false; extractFromMetadata = false; word = false; @@ -96,7 +95,6 @@ public class OptionFlags { quiet = false; checkDotError = false; printFonts = false; - // useSuggestEngine = true; // failOnError = false; encodesprite = false; // PIC_LINE = false; @@ -106,7 +104,6 @@ public class OptionFlags { return false; } - // private boolean keepTmpFiles; private boolean verbose; private boolean extractFromMetadata; private boolean word; @@ -115,7 +112,6 @@ public class OptionFlags { private boolean quiet; private boolean checkDotError; private boolean printFonts; - // private boolean useSuggestEngine; private boolean encodesprite; private boolean dumpHtmlStats; private boolean dumpStats; @@ -123,6 +119,7 @@ public class OptionFlags { private boolean overwrite; private boolean enableStats = defaultForStats(); private boolean stdLib; + private boolean silentlyCompletelyIgnoreErrors; private boolean extractStdLib; private boolean clipboardLoop; private boolean clipboard; @@ -257,14 +254,6 @@ public class OptionFlags { return false; } - // public final boolean isUseSuggestEngine() { - // return useSuggestEngine; - // } - // - // public final void setUseSuggestEngine(boolean useSuggestEngine) { - // this.useSuggestEngine = useSuggestEngine; - // } - public final boolean isEncodesprite() { return encodesprite; } @@ -368,4 +357,12 @@ public class OptionFlags { public final void setStdLib(boolean stdLib) { this.stdLib = stdLib; } + + public final boolean isSilentlyCompletelyIgnoreErrors() { + return silentlyCompletelyIgnoreErrors; + } + + public final void setSilentlyCompletelyIgnoreErrors(boolean silentlyCompletelyIgnoreErrors) { + this.silentlyCompletelyIgnoreErrors = silentlyCompletelyIgnoreErrors; + } } diff --git a/src/net/sourceforge/plantuml/OptionPrint.java b/src/net/sourceforge/plantuml/OptionPrint.java index 8743905a1..edae8e34f 100644 --- a/src/net/sourceforge/plantuml/OptionPrint.java +++ b/src/net/sourceforge/plantuml/OptionPrint.java @@ -146,6 +146,7 @@ public class OptionPrint { System.out.println(" -extractstdlib\tTo extract PlantUML Standard Library into stdlib folder"); System.out.println(" -filename \"example.puml\"\tTo override %filename% variable"); System.out.println(" -preproc\t\tTo output preprocessor text of diagrams"); + System.out.println(" -cypher\t\tTo cypher texts of diagrams so that you can share them"); System.out.println(); System.out.println("If needed, you can setup the environment variable GRAPHVIZ_DOT."); exit(); diff --git a/src/net/sourceforge/plantuml/PSystemBuilder.java b/src/net/sourceforge/plantuml/PSystemBuilder.java index 54ceb2fe3..41abd02dc 100644 --- a/src/net/sourceforge/plantuml/PSystemBuilder.java +++ b/src/net/sourceforge/plantuml/PSystemBuilder.java @@ -73,6 +73,7 @@ import net.sourceforge.plantuml.jungle.PSystemTreeFactory; import net.sourceforge.plantuml.logo.PSystemLogoFactory; import net.sourceforge.plantuml.math.PSystemLatexFactory; import net.sourceforge.plantuml.math.PSystemMathFactory; +import net.sourceforge.plantuml.nwdiag.NwDiagramFactory; import net.sourceforge.plantuml.openiconic.PSystemListOpenIconicFactory; import net.sourceforge.plantuml.openiconic.PSystemOpenIconicFactory; import net.sourceforge.plantuml.oregon.PSystemOregonFactory; @@ -167,6 +168,7 @@ public class PSystemBuilder { factories.add(new PSystemSaltFactory(DiagramType.UML)); factories.add(new PSystemDotFactory(DiagramType.DOT)); factories.add(new PSystemDotFactory(DiagramType.UML)); + factories.add(new NwDiagramFactory()); if (License.getCurrent() == License.GPL || License.getCurrent() == License.GPLV2) { factories.add(new PSystemDitaaFactory(DiagramType.DITAA)); factories.add(new PSystemDitaaFactory(DiagramType.UML)); diff --git a/src/net/sourceforge/plantuml/PSystemError.java b/src/net/sourceforge/plantuml/PSystemError.java index 0b617a863..8528ad62b 100644 --- a/src/net/sourceforge/plantuml/PSystemError.java +++ b/src/net/sourceforge/plantuml/PSystemError.java @@ -85,8 +85,6 @@ import net.sourceforge.plantuml.version.PSystemVersion; public class PSystemError extends AbstractPSystem { - private static final boolean TEST1 = false; - private final LineLocation higherErrorPosition; private final List printedErrors; private final List debugLines = new ArrayList(); @@ -157,10 +155,14 @@ public class PSystemError extends AbstractPSystem { udrawable = result; } final int min = (int) (System.currentTimeMillis() / 60000L) % 60; - if (min == 0 && LicenseInfo.retrieveQuick().isValid() == false) { - udrawable = addMessage(udrawable); - } else if (TEST1 || (min == 30 && LicenseInfo.retrieveQuick().isValid() == false)) { + if (min == 1 && LicenseInfo.retrieveNamedOrDistributorQuickIsValid() == false) { + udrawable = addMessagePatreon(udrawable); + } else if (min == 15 && LicenseInfo.retrieveNamedOrDistributorQuickIsValid() == false) { + udrawable = addMessageLiberapay(udrawable); + } else if (min == 30 && LicenseInfo.retrieveNamedOrDistributorQuickIsValid() == false) { udrawable = addMessageDedication(udrawable); + } else if (getSource().containsIgnoreCase("arecibo")) { + udrawable = addMessageArecibo(udrawable); } imageBuilder.setUDrawable(udrawable); final ImageData imageData = imageBuilder.writeImageTOBEMOVED(fileFormat, seed(), os); @@ -177,8 +179,15 @@ public class PSystemError extends AbstractPSystem { return TextBlockUtils.mergeTB(welcome, result, HorizontalAlignment.LEFT); } - private TextBlock addMessage(final TextBlock source) throws IOException { - final TextBlock message = getMessage(); + private TextBlock addMessageLiberapay(final TextBlock source) throws IOException { + final TextBlock message = getMessageLiberapay(); + TextBlock result = TextBlockUtils.mergeTB(message, source, HorizontalAlignment.LEFT); + result = TextBlockUtils.mergeTB(result, message, HorizontalAlignment.LEFT); + return result; + } + + private TextBlock addMessagePatreon(final TextBlock source) throws IOException { + final TextBlock message = getMessagePatreon(); TextBlock result = TextBlockUtils.mergeTB(message, source, HorizontalAlignment.LEFT); result = TextBlockUtils.mergeTB(result, message, HorizontalAlignment.LEFT); return result; @@ -190,14 +199,20 @@ public class PSystemError extends AbstractPSystem { return result; } + private TextBlock addMessageArecibo(final TextBlock source) throws IOException { + final UImage message = new UImage(PSystemVersion.getArecibo()); + TextBlock result = TextBlockUtils.mergeLR(source, TextBlockUtils.fromUImage(message), VerticalAlignment.TOP); + return result; + } + private TextBlockBackcolored getMessageDedication() { final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils(); final HtmlColorSimple backColor = (HtmlColorSimple) new HtmlColorSetSimple().getColorIfValid("#DFDCD3"); final BufferedImage qrcode = smaller(utils.exportFlashcode("http://plantuml.com/dedication", Color.BLACK, backColor.getColor999())); - final Display disp = Display.create("Add your own dedication into PlantUML", " ", - "For just $5 per month!", "Details on [[http://plantuml.com/dedication]]"); + final Display disp = Display.create("Add your own dedication into PlantUML", " ", "For just $5 per month!", + "Details on [[http://plantuml.com/dedication]]"); final UFont font = UFont.sansSerif(14); final FontConfiguration fc = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false); @@ -214,13 +229,58 @@ public class PSystemError extends AbstractPSystem { } - private TextBlockBackcolored getMessage() { - final UImage message = new UImage(PSystemVersion.getTime()); + private TextBlockBackcolored getMessagePatreon() { + final UImage message = new UImage(PSystemVersion.getTime01()); final Color back = new Color(message.getImage().getRGB(0, 0)); final HtmlColor backColor = new HtmlColorSimple(back, false); final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils(); - final BufferedImage qrcode = smaller(utils.exportFlashcode("http://plantuml.com/patreon", back, Color.WHITE)); + final BufferedImage qrcode = smaller(utils.exportFlashcode("http://plantuml.com/patreon", Color.BLACK, + Color.WHITE)); + + final int scale = 2; + + final double imWidth = message.getWidth() + (qrcode == null ? 0 : qrcode.getWidth() * scale + 20); + final double imHeight = qrcode == null ? message.getHeight() : Math.max(message.getHeight(), qrcode.getHeight() + * scale + 10); + return new TextBlockBackcolored() { + + public void drawU(UGraphic ug) { + if (qrcode == null) { + ug.apply(new UTranslate(1, 1)).draw(message); + } else { + final UImage qr = new UImage(qrcode).scaleNearestNeighbor(scale); + ug.apply(new UTranslate(1, (imHeight - message.getHeight()) / 2)).draw(message); + ug.apply(new UTranslate(1 + message.getWidth(), (imHeight - qr.getHeight()) / 2)).draw(qr); + } + } + + public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) { + return null; + } + + public Dimension2D calculateDimension(StringBounder stringBounder) { + return new Dimension2DDouble(imWidth + 1, imHeight + 1); + } + + public MinMax getMinMax(StringBounder stringBounder) { + return MinMax.fromMax(imWidth + 1, imHeight + 1); + } + + public HtmlColor getBackcolor() { + return backColor; + } + }; + + } + + private TextBlockBackcolored getMessageLiberapay() { + final UImage message = new UImage(PSystemVersion.getTime15()); + final Color back = new Color(message.getImage().getRGB(0, 0)); + final HtmlColor backColor = new HtmlColorSimple(back, false); + + final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils(); + final BufferedImage qrcode = smaller(utils.exportFlashcode("http://plantuml.com/lp", Color.BLACK, Color.WHITE)); final int scale = 2; diff --git a/src/net/sourceforge/plantuml/Run.java b/src/net/sourceforge/plantuml/Run.java index 27fc1bfa1..e19d03326 100644 --- a/src/net/sourceforge/plantuml/Run.java +++ b/src/net/sourceforge/plantuml/Run.java @@ -497,6 +497,9 @@ public class Run { return false; } final List result = sourceFileReader.getGeneratedImages(); + if (result.size() == 0) { + Log.error("Warning: no image in " + f.getCanonicalPath()); + } return hasErrors(f, result); } diff --git a/src/net/sourceforge/plantuml/SkinParam.java b/src/net/sourceforge/plantuml/SkinParam.java index 254d58310..b8854da9c 100644 --- a/src/net/sourceforge/plantuml/SkinParam.java +++ b/src/net/sourceforge/plantuml/SkinParam.java @@ -416,7 +416,7 @@ public class SkinParam implements ISkinParam { result.add("HyperlinkUnderline"); result.add("Padding"); result.add("BoxPadding"); - result.add("ParticipantPadding"); + result.add("ParticipantPadding"); result.add("Guillemet"); result.add("SvglinkTarget"); result.add("DefaultMonospacedFontName"); @@ -433,6 +433,7 @@ public class SkinParam implements ISkinParam { result.add("WrapWidth"); result.add("SwimlaneWidth"); result.add("SwimlaneWrapTitleWidth"); + result.add("FixCircleLabelOverlapping"); for (FontParam p : EnumSet.allOf(FontParam.class)) { final String h = humanName(p.name()); @@ -479,7 +480,8 @@ public class SkinParam implements ISkinParam { return DotSplines.SPLINES; } - public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDirection arrowDirection) { + public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDirection arrowDirection, + boolean isReverseDefine) { final String value; switch (param) { case sequenceMessageAlignment: @@ -491,6 +493,19 @@ public class SkinParam implements ISkinParam { default: value = getValue(param.name()); } + if ("first".equalsIgnoreCase(value)) { + if (arrowDirection == ArrowDirection.RIGHT_TO_LEFT_REVERSE) { + if (isReverseDefine) { + return HorizontalAlignment.LEFT; + } + return HorizontalAlignment.RIGHT; + } else { + if (isReverseDefine) { + return HorizontalAlignment.RIGHT; + } + return HorizontalAlignment.LEFT; + } + } if ("direction".equalsIgnoreCase(value)) { if (arrowDirection == ArrowDirection.LEFT_TO_RIGHT_NORMAL) { return HorizontalAlignment.LEFT; diff --git a/src/net/sourceforge/plantuml/SkinParamDelegator.java b/src/net/sourceforge/plantuml/SkinParamDelegator.java index cefa04beb..afae94515 100644 --- a/src/net/sourceforge/plantuml/SkinParamDelegator.java +++ b/src/net/sourceforge/plantuml/SkinParamDelegator.java @@ -103,8 +103,8 @@ public class SkinParamDelegator implements ISkinParam { return skinParam.getDotExecutable(); } - public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDirection arrowDirection) { - return skinParam.getHorizontalAlignment(param, arrowDirection); + public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDirection arrowDirection, boolean isReverseDefine) { + return skinParam.getHorizontalAlignment(param, arrowDirection, isReverseDefine); } public ColorMapper getColorMapper() { diff --git a/src/net/sourceforge/plantuml/SourceFileReaderAbstract.java b/src/net/sourceforge/plantuml/SourceFileReaderAbstract.java index 7b4bd1229..561844580 100644 --- a/src/net/sourceforge/plantuml/SourceFileReaderAbstract.java +++ b/src/net/sourceforge/plantuml/SourceFileReaderAbstract.java @@ -149,6 +149,10 @@ public abstract class SourceFileReaderAbstract { return getCrashedImage(blockUml, t, suggested.getFile(0)); } + if (OptionFlags.getInstance().isSilentlyCompletelyIgnoreErrors() && system instanceof PSystemError) { + continue; + } + OptionFlags.getInstance().logData(file, system); final List exportDiagrams = PSystemUtils.exportDiagrams(system, suggested, fileFormatOption, checkMetadata); diff --git a/src/net/sourceforge/plantuml/UmlDiagram.java b/src/net/sourceforge/plantuml/UmlDiagram.java index fbeebc40c..2254ba8c1 100644 --- a/src/net/sourceforge/plantuml/UmlDiagram.java +++ b/src/net/sourceforge/plantuml/UmlDiagram.java @@ -60,6 +60,7 @@ import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.core.Diagram; import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.DisplayPositionned; import net.sourceforge.plantuml.cucadiagram.DisplaySection; import net.sourceforge.plantuml.cucadiagram.UnparsableGraphvizException; @@ -98,6 +99,7 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann private DisplayPositionned legend = DisplayPositionned.none(HorizontalAlignment.CENTER, VerticalAlignment.BOTTOM); private final DisplaySection header = DisplaySection.none(); private final DisplaySection footer = DisplaySection.none(); + private Display mainFrame; private final Pragma pragma = new Pragma(); private Animation animation; @@ -111,6 +113,10 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann this.title = title; } + final public void setMainFrame(Display mainFrame) { + this.mainFrame = mainFrame; + } + final public void setCaption(DisplayPositionned caption) { this.caption = caption; } @@ -210,7 +216,7 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann throws IOException { final HtmlColor hover = getSkinParam().getHoverPathColor(); - if (fileFormatOption.getSvgLinkTarget() == null) { + if (fileFormatOption.getSvgLinkTarget() == null || fileFormatOption.getSvgLinkTarget().equals("_top")) { fileFormatOption = fileFormatOption.withSvgLinkTarget(getSkinParam().getSvgLinkTarget()); } fileFormatOption = fileFormatOption.withTikzFontDistortion(getSkinParam().getTikzFontDistortion()); @@ -439,7 +445,11 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann return useJDot; } - public void setDotExecutable(String dotExecutable) { + private void setDotExecutable(String dotExecutable) { skinParam.setDotExecutable(dotExecutable); } + + public final Display getMainFrame() { + return mainFrame; + } } diff --git a/src/net/sourceforge/plantuml/UmlDiagramType.java b/src/net/sourceforge/plantuml/UmlDiagramType.java index e2abea3c9..dee8a46e7 100644 --- a/src/net/sourceforge/plantuml/UmlDiagramType.java +++ b/src/net/sourceforge/plantuml/UmlDiagramType.java @@ -36,5 +36,5 @@ package net.sourceforge.plantuml; public enum UmlDiagramType { - SEQUENCE, STATE, CLASS, OBJECT, ACTIVITY, DESCRIPTION, COMPOSITE, FLOW, TIMING, BPM + SEQUENCE, STATE, CLASS, OBJECT, ACTIVITY, DESCRIPTION, COMPOSITE, FLOW, TIMING, BPM, NWDIAG } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java index eeb122f29..34174c371 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java @@ -199,7 +199,7 @@ public class ActivityDiagram3 extends UmlDiagram { result = new TextBlockCompressedOnXorY(CompressionMode.ON_Y, result); result = new TextBlockRecentred(result); final ISkinParam skinParam = getSkinParam(); - result = new AnnotatedWorker(this, skinParam).addAdd(result); + result = new AnnotatedWorker(this, skinParam, fileFormatOption.getDefaultStringBounder()).addAdd(result); // final Dimension2D dim = TextBlockUtils.getMinMax(result, fileFormatOption.getDefaultStringBounder()) // .getDimension(); final Dimension2D dim = result.getMinMax(fileFormatOption.getDefaultStringBounder()).getDimension(); @@ -390,10 +390,11 @@ public class ActivityDiagram3 extends UmlDiagram { return CommandExecutionResult.ok(); } - public void startGroup(Display name, HtmlColor backColor, HtmlColor titleColor, HtmlColor borderColor, USymbol type) { + public void startGroup(Display name, HtmlColor backColor, HtmlColor titleColor, HtmlColor borderColor, + USymbol type, double roundCorner) { manageSwimlaneStrategy(); final InstructionGroup instructionGroup = new InstructionGroup(current(), name, backColor, titleColor, - swinlanes.getCurrentSwimlane(), borderColor, nextLinkRenderer(), type); + swinlanes.getCurrentSwimlane(), borderColor, nextLinkRenderer(), type, roundCorner); current().add(instructionGroup); setCurrent(instructionGroup); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java index 0a6e3ad30..d8cbe10c3 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java @@ -60,10 +60,11 @@ public class InstructionGroup implements Instruction, InstructionCollection { private final USymbol type; private final Display test; + private final double roundCorner; private PositionedNote note = null; public InstructionGroup(Instruction parent, Display test, HtmlColor backColor, HtmlColor titleColor, - Swimlane swimlane, HtmlColor borderColor, LinkRendering linkRendering, USymbol type) { + Swimlane swimlane, HtmlColor borderColor, LinkRendering linkRendering, USymbol type, double roundCorner) { this.list = new InstructionList(swimlane); this.type = type; this.linkRendering = linkRendering; @@ -72,6 +73,7 @@ public class InstructionGroup implements Instruction, InstructionCollection { this.borderColor = borderColor; this.backColor = backColor; this.titleColor = titleColor; + this.roundCorner = roundCorner; } public void add(Instruction ins) { @@ -83,7 +85,7 @@ public class InstructionGroup implements Instruction, InstructionCollection { if (note != null) { tmp = new FtileWithNotes(tmp, Collections.singleton(note), factory.skinParam()); } - return factory.createGroup(tmp, test, backColor, titleColor, null, borderColor, type); + return factory.createGroup(tmp, test, backColor, titleColor, null, borderColor, type, roundCorner); } public Instruction getParent() { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGroup3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGroup3.java index 38cd1f0a9..7ae135752 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGroup3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandGroup3.java @@ -60,7 +60,7 @@ public class CommandGroup3 extends SingleLineCommand2 { @Override protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) { - diagram.startGroup(Display.getWithNewlines(arg.get("NAME", 0)), null, null, null, USymbol.FRAME); + diagram.startGroup(Display.getWithNewlines(arg.get("NAME", 0)), null, null, null, USymbol.FRAME, 0); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java index 6af839811..e16c19cb0 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java @@ -45,6 +45,7 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf; import net.sourceforge.plantuml.command.regex.RegexOptional; import net.sourceforge.plantuml.command.regex.RegexResult; import net.sourceforge.plantuml.cucadiagram.Display; +import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.graphic.HtmlColor; import net.sourceforge.plantuml.graphic.HtmlColorUtils; import net.sourceforge.plantuml.graphic.USymbol; @@ -71,7 +72,10 @@ public class CommandPartition3 extends SingleLineCommand2 { new RegexConcat( // new RegexLeaf("[%s]+"), // color("BACK2").getRegex())), // - new RegexLeaf("[%s]*\\{?$")); + new RegexLeaf("[%s]*"), // + new RegexLeaf("STEREO", "(\\<{2}.*\\>{2})?"), // + new RegexLeaf("[%s]*"), // + new RegexLeaf("\\{?$")); } private USymbol getUSymbol(String type) { @@ -87,6 +91,20 @@ public class CommandPartition3 extends SingleLineCommand2 { return USymbol.FRAME; } + private ColorParam getColorParamBorder(final USymbol symbol) { + if (symbol == USymbol.FRAME) { + return ColorParam.partitionBorder; + } + return symbol.getColorParamBorder(); + } + + private ColorParam getColorParamBack(final USymbol symbol) { + if (symbol == USymbol.FRAME) { + return ColorParam.partitionBackground; + } + return symbol.getColorParamBack(); + } + private static ColorParser color(String id) { return ColorParser.simpleColor(ColorType.BACK, id); } @@ -99,8 +117,12 @@ public class CommandPartition3 extends SingleLineCommand2 { final Colors colors = color(b1 == null ? "BACK2" : "BACK1").getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); - final HtmlColor backColorInSkinparam = diagram.getSkinParam().getHtmlColor(ColorParam.partitionBackground, - null, false); + final USymbol symbol = getUSymbol(arg.get("TYPE", 0)); + final String stereo = arg.get("STEREO", 0); + final Stereotype stereotype = stereo == null ? null : new Stereotype(stereo); + + final HtmlColor backColorInSkinparam = diagram.getSkinParam().getHtmlColor(getColorParamBack(symbol), + stereotype, false); final HtmlColor backColor; if (backColorInSkinparam == null) { backColor = colors.getColor(ColorType.BACK); @@ -110,13 +132,14 @@ public class CommandPartition3 extends SingleLineCommand2 { final HtmlColor titleColor = colors.getColor(ColorType.HEADER); // Warning : titleColor unused in FTileGroupW - HtmlColor borderColor = diagram.getSkinParam().getHtmlColor(ColorParam.partitionBorder, null, false); + HtmlColor borderColor = diagram.getSkinParam().getHtmlColor(getColorParamBorder(symbol), stereotype, false); if (borderColor == null) { borderColor = HtmlColorUtils.BLACK; } + final double roundCorner = symbol.getSkinParameter().getRoundCorner(diagram.getSkinParam(), stereotype); - diagram.startGroup(Display.getWithNewlines(partitionTitle), backColor, titleColor, borderColor, - getUSymbol(arg.get("TYPE", 0))); + diagram.startGroup(Display.getWithNewlines(partitionTitle), backColor, titleColor, borderColor, symbol, + roundCorner); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java index 7d3984a36..4a7a25a0d 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java @@ -98,7 +98,7 @@ public abstract class AbstractFtile extends AbstractTextBlock implements Ftile { } public HorizontalAlignment arrowHorizontalAlignment() { - return skinParam.getHorizontalAlignment(AlignmentParam.arrowMessageAlignment, null); + return skinParam.getHorizontalAlignment(AlignmentParam.arrowMessageAlignment, null, false); } private FtileGeometry cachedGeometry; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java index 2755d3408..dd0bffbfe 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java @@ -90,6 +90,6 @@ public interface FtileFactory { public Ftile createParallel(Swimlane swimlane, List all, ForkStyle style, String label); public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note, - HtmlColor borderColor, USymbol type); + HtmlColor borderColor, USymbol type, double roundCorner); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java index 5fe70715f..cebcfa15c 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java @@ -168,8 +168,8 @@ public class FtileFactoryDelegator implements FtileFactory { } public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note, - HtmlColor borderColor, USymbol type) { - return factory.createGroup(list, name, backColor, titleColor, note, borderColor, type); + HtmlColor borderColor, USymbol type, double roundCorner) { + return factory.createGroup(list, name, backColor, titleColor, note, borderColor, type, roundCorner); } public StringBounder getStringBounder() { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java index bb8e40202..e9a72a5da 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java @@ -57,9 +57,10 @@ public class FtileFactoryDelegatorCreateGroup extends FtileFactoryDelegator { @Override public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note, - HtmlColor borderColor, USymbol type) { + HtmlColor borderColor, USymbol type, double roundCorner) { final HtmlColor arrowColor = rose.getHtmlColor(skinParam(), ColorParam.arrow); - Ftile result = new FtileGroup(list, name, null, arrowColor, backColor, titleColor, skinParam(), borderColor, type); + Ftile result = new FtileGroup(list, name, null, arrowColor, backColor, titleColor, skinParam(), borderColor, + type, roundCorner); if (note != null) { result = new FtileWithNotes(result, Collections.singleton(note), skinParam()); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java index bc57f6271..6af19338f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java @@ -78,10 +78,12 @@ public class FtileGroup extends AbstractFtile { private final HtmlColor backColor; private final UStroke stroke; private final USymbol type; + private final double roundCorner; public FtileGroup(Ftile inner, Display title, Display displayNote, HtmlColor arrowColor, HtmlColor backColor, - HtmlColor titleColor, ISkinParam skinParam, HtmlColor borderColor, USymbol type) { + HtmlColor titleColor, ISkinParam skinParam, HtmlColor borderColor, USymbol type, double roundCorner) { super(inner.skinParam()); + this.roundCorner = roundCorner; this.type = type; this.backColor = backColor == null ? HtmlColorUtils.WHITE : backColor; this.inner = FtileUtils.addHorizontalMargin(inner, 10); @@ -196,9 +198,11 @@ public class FtileGroup extends AbstractFtile { final StringBounder stringBounder = ug.getStringBounder(); final Dimension2D dimTotal = calculateDimension(stringBounder); - final SymbolContext symbolContext = new SymbolContext(backColor, borderColor).withShadow( - skinParam().shadowing(null)).withStroke(stroke); - type.asBig(name, inner.skinParam().getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null), + // final double roundCorner = type.getSkinParameter().getRoundCorner(skinParam(), null); + final SymbolContext symbolContext = new SymbolContext(backColor, borderColor) + .withShadow(skinParam().shadowing(null)).withStroke(stroke).withCorner(roundCorner, 0); + + type.asBig(name, inner.skinParam().getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false), TextBlockUtils.empty(0, 0), dimTotal.getWidth(), dimTotal.getHeight(), symbolContext).drawU(ug); final Dimension2D dimHeaderNote = headerNote.calculateDimension(stringBounder); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit2.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit2.java index c44227112..d81070686 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit2.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit2.java @@ -78,7 +78,7 @@ public class ParallelBuilderSplit2 extends ParallelFtilesBuilder { for (Ftile tmp : getList()) { final FtileGeometry dim = tmp.calculateDimension(getStringBounder()); if (first == 0) { - first = dim.getLeft(); + first = x + dim.getLeft(); } last = x + dim.getLeft(); conns.add(new ConnectionIn(thin, tmp, x, tmp.getInLinkRendering().getRainbow( @@ -123,7 +123,7 @@ public class ParallelBuilderSplit2 extends ParallelFtilesBuilder { final FtileGeometry dim = tmp.calculateDimension(getStringBounder()); if (dim.hasPointOut()) { if (first == 0) { - first = dim.getLeft(); + first = x + dim.getLeft(); } last = x + dim.getLeft(); } @@ -134,6 +134,9 @@ public class ParallelBuilderSplit2 extends ParallelFtilesBuilder { if (last < geom.getLeft()) { last = geom.getLeft(); } + if (first > geom.getLeft()) { + first = geom.getLeft(); + } ((FtileThinSplit) out).setGeom(first, last, geom.getWidth()); result = FtileUtils.addConnection(result, conns); return result; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java index 4c2ed2574..1ca6377c5 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java @@ -150,7 +150,7 @@ public class VCompactFactory implements FtileFactory { } public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note, - HtmlColor borderColor, USymbol type) { + HtmlColor borderColor, USymbol type, double roundCorner) { return list; } diff --git a/src/net/sourceforge/plantuml/command/CommandPragma.java b/src/net/sourceforge/plantuml/command/CommandPragma.java index ec712ecb7..a43070543 100644 --- a/src/net/sourceforge/plantuml/command/CommandPragma.java +++ b/src/net/sourceforge/plantuml/command/CommandPragma.java @@ -53,9 +53,13 @@ public class CommandPragma extends SingleLineCommand { system.getPragma().define(name, value); if (name.equalsIgnoreCase("graphviz_dot") && value.equalsIgnoreCase("jdot")) { system.setUseJDot(true); - } else if (name.equalsIgnoreCase("graphviz_dot")) { - system.setDotExecutable(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(value)); } + // else if (name.equalsIgnoreCase("graphviz_dot") && OptionFlags.ALLOW_INCLUDE) { + // final String cmd = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(value); + // if (cmd.toLowerCase().endsWith("dot") || cmd.toLowerCase().endsWith("dot.exe")) { + // system.setDotExecutable(cmd); + // } + // } return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/command/PSystemBasicFactory.java b/src/net/sourceforge/plantuml/command/PSystemBasicFactory.java index f9f0b7775..be863ff97 100644 --- a/src/net/sourceforge/plantuml/command/PSystemBasicFactory.java +++ b/src/net/sourceforge/plantuml/command/PSystemBasicFactory.java @@ -67,6 +67,7 @@ public abstract class PSystemBasicFactory

extends PSy } final public Diagram createSystem(UmlSource source) { + source = source.removeInitialSkinparam(); final IteratorCounter2 it = source.iterator2(); final CharSequence2 startLine = it.next(); P system = init(startLine.toString2()); @@ -88,8 +89,7 @@ public abstract class PSystemBasicFactory

extends PSy } system = executeLine(system, s.toString2()); if (system == null) { - final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?", - /* it.currentNum() - 1, */s.getLocation()); + final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?", s.getLocation()); return new PSystemError(source, err, null); } } diff --git a/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java b/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java index c323dac35..c77f666f5 100644 --- a/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java +++ b/src/net/sourceforge/plantuml/command/UmlDiagramFactory.java @@ -209,6 +209,7 @@ public abstract class UmlDiagramFactory extends PSystemAbstractFactory { // cmds.add(new CommandMultilinesComment()); cmds.add(new CommandPragma()); cmds.add(new CommandTitle()); + cmds.add(new CommandMainframe()); cmds.add(new CommandCaption()); cmds.add(new CommandMultilinesTitle()); cmds.add(new CommandMultilinesLegend()); diff --git a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteCommand.java b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteCommand.java index 0c2639825..632f4d8ce 100644 --- a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteCommand.java +++ b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteCommand.java @@ -51,6 +51,7 @@ import net.sourceforge.plantuml.command.note.SingleMultiFactoryCommand; import net.sourceforge.plantuml.command.regex.RegexConcat; import net.sourceforge.plantuml.command.regex.RegexLeaf; import net.sourceforge.plantuml.command.regex.RegexResult; +import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.graphic.color.ColorParser; import net.sourceforge.plantuml.graphic.color.ColorType; @@ -136,7 +137,8 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma if (strings.size() > 0) { final boolean tryMerge = arg.get("VMERGE", 0) != null; - final Note note = new Note(p, position, strings.toDisplay()); + final Display display = diagram.manageVariable(strings.toDisplay()); + final Note note = new Note(p, position, display); Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); final String stereotypeString = arg.get("STEREO", 0); if (stereotypeString != null) { diff --git a/src/net/sourceforge/plantuml/core/DiagramType.java b/src/net/sourceforge/plantuml/core/DiagramType.java index 8da57c9b6..d58a5d079 100644 --- a/src/net/sourceforge/plantuml/core/DiagramType.java +++ b/src/net/sourceforge/plantuml/core/DiagramType.java @@ -38,7 +38,7 @@ package net.sourceforge.plantuml.core; import net.sourceforge.plantuml.utils.StartUtils; public enum DiagramType { - UML, BPM, DITAA, DOT, PROJECT, JCCKIT, SALT, FLOW, CREOLE, JUNGLE, CUTE, MATH, LATEX, DEFINITION, GANTT, UNKNOWN; + UML, BPM, DITAA, DOT, PROJECT, JCCKIT, SALT, FLOW, CREOLE, JUNGLE, CUTE, MATH, LATEX, DEFINITION, GANTT, NW, UNKNOWN; static public DiagramType getTypeFromArobaseStart(String s) { s = s.toLowerCase(); @@ -90,6 +90,9 @@ public enum DiagramType { if (StartUtils.startsWithSymbolAnd("startgantt", s)) { return GANTT; } + if (StartUtils.startsWithSymbolAnd("startnwdiag", s)) { + return NW; + } return UNKNOWN; } } diff --git a/src/net/sourceforge/plantuml/core/UmlSource.java b/src/net/sourceforge/plantuml/core/UmlSource.java index 0e3e03b39..c4623ff3f 100644 --- a/src/net/sourceforge/plantuml/core/UmlSource.java +++ b/src/net/sourceforge/plantuml/core/UmlSource.java @@ -36,7 +36,6 @@ package net.sourceforge.plantuml.core; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -65,42 +64,62 @@ import net.sourceforge.plantuml.version.IteratorCounter2Impl; */ final public class UmlSource { - final private List source; - final private List source2; + final private List source; + + public UmlSource removeInitialSkinparam() { + if (hasInitialSkinparam(source) == false) { + return this; + } + final List copy = new ArrayList(source); + while (hasInitialSkinparam(copy)) { + copy.remove(1); + } + return new UmlSource(copy); + } + + public boolean containsIgnoreCase(String searched) { + for (CharSequence2 s : source) { + if (StringUtils.goLowerCase(s.toString()).contains(searched)) { + return true; + } + } + return false; + } + + private static boolean hasInitialSkinparam(final List copy) { + return copy.size() > 1 && (copy.get(1).startsWith("skinparam ") || copy.get(1).startsWith("skinparamlocked ")); + } + + private UmlSource(List source) { + this.source = source; + } /** * Build the source from a text. * - * @param source + * @param data * the source of the diagram * @param checkEndingBackslash * true if an ending backslash means that a line has to be collapsed with the following one. */ - public UmlSource(List source, boolean checkEndingBackslash) { - final List tmp = new ArrayList(); - final List tmp2 = new ArrayList(); + public UmlSource(List data, boolean checkEndingBackslash) { + this(new ArrayList()); if (checkEndingBackslash) { final StringBuilder pending = new StringBuilder(); - for (CharSequence2 cs : source) { + for (CharSequence2 cs : data) { final String s = cs.toString2(); if (StringUtils.endsWithBackslash(s)) { pending.append(s.substring(0, s.length() - 1)); } else { pending.append(s); - tmp.add(pending.toString()); - tmp2.add(new CharSequence2Impl(pending.toString(), cs.getLocation())); + this.source.add(new CharSequence2Impl(pending.toString(), cs.getLocation())); pending.setLength(0); } } } else { - for (CharSequence2 s : source) { - tmp.add(s.toString2()); - tmp2.add(s); - } + this.source.addAll(data); } - this.source = Collections.unmodifiableList(tmp); - this.source2 = Collections.unmodifiableList(tmp2); } /** @@ -109,7 +128,7 @@ final public class UmlSource { * @return the type of the diagram. */ public DiagramType getDiagramType() { - return DiagramType.getTypeFromArobaseStart(source.get(0)); + return DiagramType.getTypeFromArobaseStart(source.get(0).toString2()); } /** @@ -118,7 +137,7 @@ final public class UmlSource { * @return a iterator that allow counting line number. */ public IteratorCounter2 iterator2() { - return new IteratorCounter2Impl(source2); + return new IteratorCounter2Impl(source); } /** @@ -128,7 +147,7 @@ final public class UmlSource { */ public String getPlainString() { final StringBuilder sb = new StringBuilder(); - for (String s : source) { + for (CharSequence2 s : source) { sb.append(s); sb.append('\r'); sb.append(BackSlash.CHAR_NEWLINE); @@ -147,22 +166,8 @@ final public class UmlSource { return h; } - /** - * Return a specific line of the diagram description. - * - * @param n - * line number, starting at 0 - * @return - */ - private String getLine(int n) { - if (n < 0 || n >= source.size()) { - return ""; - } - return source.get(n); - } - public String getLine(LineLocation n) { - for (CharSequence2 s : source2) { + for (CharSequence2 s : source) { if (s.getLocation().compareTo(n) == 0) { return s.toString(); } @@ -185,14 +190,14 @@ final public class UmlSource { * @return true if the diagram does not contain information. */ public boolean isEmpty() { - for (String s : source) { + for (CharSequence2 s : source) { if (StartUtils.isArobaseStartDiagram(s)) { continue; } if (StartUtils.isArobaseEndDiagram(s)) { continue; } - if (s.matches("\\s*'.*")) { + if (s.toString().matches("\\s*'.*")) { continue; } if (StringUtils.trin(s).length() != 0) { @@ -209,7 +214,7 @@ final public class UmlSource { */ public Display getTitle() { final Pattern2 p = MyPattern.cmpile("(?i)^[%s]*title[%s]+(.+)$"); - for (String s : source) { + for (CharSequence2 s : source) { final Matcher2 m = p.matcher(s); final boolean ok = m.matches(); if (ok) { @@ -232,7 +237,4 @@ final public class UmlSource { return null; } - // public final int getStartLine() { - // return startLine; - // } } diff --git a/src/net/sourceforge/plantuml/cucadiagram/Link.java b/src/net/sourceforge/plantuml/cucadiagram/Link.java index d086c8e90..e4f9cdc95 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/Link.java +++ b/src/net/sourceforge/plantuml/cucadiagram/Link.java @@ -46,7 +46,6 @@ import net.sourceforge.plantuml.command.Position; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.HtmlColorSet; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.USymbolInterface; diff --git a/src/net/sourceforge/plantuml/cucadiagram/WithLinkType.java b/src/net/sourceforge/plantuml/cucadiagram/WithLinkType.java index 6e85c7a74..9eb96c41d 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/WithLinkType.java +++ b/src/net/sourceforge/plantuml/cucadiagram/WithLinkType.java @@ -46,6 +46,7 @@ public abstract class WithLinkType { protected LinkType type; protected boolean hidden = false; + private boolean single = false; private Colors colors = Colors.empty(); @@ -87,6 +88,14 @@ public abstract class WithLinkType { type = type.goBold(); } + public final void goSingle() { + this.single = true; + } + + public boolean isSingle() { + return single; + } + public void applyStyle(String arrowStyle) { if (arrowStyle == null) { return; @@ -102,6 +111,8 @@ public abstract class WithLinkType { this.goDotted(); } else if (s.equalsIgnoreCase("hidden")) { this.goHidden(); + } else if (s.equalsIgnoreCase("single")) { + this.goSingle(); } else if (s.equalsIgnoreCase("plain")) { // Do nothing } else if (s.equalsIgnoreCase("norank")) { diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java index 4e6c0daa3..a690c9b63 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java +++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java @@ -66,7 +66,7 @@ public class GraphvizUtils { } public static final void setDotExecutable(String value) { - dotExecutable = value; + dotExecutable = value == null ? null : value.trim(); } public static Graphviz create(ISkinParam skinParam, String dotString, String... type) { diff --git a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java index 99d6d28f8..4e48d9280 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java +++ b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java @@ -180,9 +180,21 @@ public class EntityFactory { } public void addLink(Link link) { + if (link.isSingle() && containsSimilarLink(link)) { + return; + } links.add(link); } + private boolean containsSimilarLink(Link other) { + for (Link link : links) { + if (other.sameConnections(link)) { + return true; + } + } + return false; + } + public void removeLink(Link link) { final boolean ok = links.remove(link); if (ok == false) { diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java index ab83b15e8..0a4377fc5 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java @@ -62,8 +62,8 @@ import net.sourceforge.plantuml.graphic.color.ColorType; public class CommandLinkElement extends SingleLineCommand2 { - static private final String KEY1 = "dotted|dashed|plain|bold|hidden|norank|thickness=\\d+"; - static private final String KEY2 = ",dotted|,dashed|,plain|,bold|,hidden|,norank|,thickness=\\d+"; + static private final String KEY1 = "dotted|dashed|plain|bold|hidden|norank|single|thickness=\\d+"; + static private final String KEY2 = ",dotted|,dashed|,plain|,bold|,hidden|,norank|,single|,thickness=\\d+"; static public final String LINE_STYLE = "(?:#\\w+|" + CommandLinkElement.KEY1 + ")(?:,#\\w+|" + CommandLinkElement.KEY2 + ")*"; diff --git a/src/net/sourceforge/plantuml/donors/PSystemDonors.java b/src/net/sourceforge/plantuml/donors/PSystemDonors.java index 239ec01d1..2165e0742 100644 --- a/src/net/sourceforge/plantuml/donors/PSystemDonors.java +++ b/src/net/sourceforge/plantuml/donors/PSystemDonors.java @@ -67,21 +67,21 @@ import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.version.PSystemVersion; public class PSystemDonors extends AbstractPSystem { - public static final String DONORS = "6oq809m7nctnXhJewjSHZX8n3MVAYw086_hm054IjRdwqUp4_JWT81c0qvE5N5zqDfkGDMFIZSqPpZEA" - + "Oa7GUDPF7RQvsHzYgMp_PU9sNGTigUPAY0UnNlhpz-w1eq0MjocFC0vilaMDlMmEkoSg6tJxTDy7_Hze" - + "JAENBVkKjNs_Z-F8-XAoLMPVamaYHTyS9QnaASP-H8gkRcm1Ekvq8zutkcDy8VtZFse1JLgpQKXu3IYM" - + "aIBMlErj_ZZ0-0v6CQ0QwWu72GY74eVy0eE_Fv40AhLgr8YEOXhhpjvv8e494rHOmJzoafrRoF8eGmSg" - + "ZQkXWCvFu0HWRuehuMphDY1N2xR8Qx1KDwuN8bBxY-4fBWyDbu4T6X6K0ge0yYReWb-bpLpIkOvTKSEV" - + "t9NnbWr0tcJWiVHaeQyphmoKh_LJCr5T7jIt5b8vvJh7lyu6UTQGaNkxQJskMOp7_36NnF2b1SWlG2zj" - + "6oh6yulpPY41mcDANKZMENHydI9WrbaA2x-8AQzn_-WoYzN5V6l1GZt4NpSEPHb6w4h4DQ1lQBcShFE5" - + "vAwX_dt8rQxZMt2DoyAz9MfssfpFVo-xfPbHUe3MDz57wCg8SiE-QfKh9aC4hW3z6F8Ga3jGVviygc_B" - + "X_ZR_e32cnSEH6apflr5TKQZo64LPi6amrqi09ExHBbGQTr863vreAjGvH8PuQw_Rb8zRDgOE6_KZciz" - + "mXZKb-a4-IBYOYw8aeOkMJPpXxLtE0euWuBp-h6NvQm2cDVqRbiiZHSPyFSmfndIVKG-ZhGb4KKT9RES" - + "jtXM5tzkRYT_7ZhrXsD-5lMySVp1uyyXOz5yJPzAwXPZxXeqVrj2bhKxb9G5LiDr-q0DPZm6dC-QF5F9" - + "4IgruGo7Gan0w6qxhnq52xYjasgiSxQdfYNCtdFr4EWcFonl8539Tznnn3dk59wXF8hi5-UzCkgclWz9" - + "SHQGFuO9BbAXt4P8KWsRCyYGVV_gwOuEdldI5WkvRVnIUCoXy0aJhHitq365z6YHtwZh05pFJPrw2MDY" - + "1F0zJh-X7ZNh8AEDbbQC0xYb90IeWfBR_-7iL2gxDOtr5hrksxQFPUEl_ynP9ZabuZ9M2v3g82h_nHJ-" - + "J5qKuE2k_lU2Zwgq5Z82J-facoifz000"; + public static final String DONORS = "6rK809m7nctnXhJewjSHZX8n3MVAYw086_hm054IjRdwqUp4_JWT81c0qvE5N5zqDfkGDMFIpNEMyuoY" + + "M3uDM2zrsEPcFuYbilsNYTjr7R2bcYiX7iHwwS_VkmUE0bdSfipZmCR6EPRTasMlw6Rt1Lf0zRVHovPz" + + "IWKtWSqlH9CQulutnzUhP56CxXGfihgn1SYueqQmRtIEyGNrnd_K8ZLfpQOXxZM0M4OAMVEsokHnaFqd" + + "C50Y9r5tC8250uc3Vv63lZ-X05AnQjZmZs8orbgzvma799HG8GN_o4brRY7XKGOFv2Ik1W8oFu4HWBrM" + + "K4dCrkm6P6aHBP8Q17N5Ui4Zih-OcZBdISDvv0w925e1LG2v2Bh0LsapboZNiIiiUFokZ7Ux542kiWO0" + + "wSc2ljgwCc3-rqzchBgygMyjf7FATOv_dGtmh24pztOpkdXaCHRpnrmAmnSBa5-0JcqRBCRpY_FEGWm4" + + "nvIweCpPStoTHC2ainGMVX5BMZF_hKlLMb74jsOi-W_xwugXX644LoAk0NnDo-8adIyKTmtrxqEkTXtV" + + "8jPO9DIReMUdpEdizx9RYXcb6sXn4pfCbqUO6_QLLQ9OD14O0Vezu259xgJws-HHVLi-nDxs9y6yQU60" + + "v3PZxE-gCnn53giW2zAsjui5m6ILQ1ToKZVYXaCTw2get4CZtFNNJRg7JHaJvutUyLWFCmRr9Jf6ll2u" + + "c4j6SKEBp9lDXxItE0gu4L-SruzzgCzL0ElgtbMBq7W50_eUvWn3UWt9nv6snAEemumijmNFwcBFpUta" + + "vg4ZVpXcjgZdZUCF7dyUCXDgtzkdbhf5cBi6GzyQapNPorEKMrWDrL616f5n7t0-CpbIoH5oOiEP3e6O" + + "926txRns5DJWaYSM-dNBzjIq1Dcxh-u2tS4FoniPgFWxvY3YxE-KEAFNAB9VCU_Ch9lwFgJ4kO2SCKHm" + + "bmhcDaAAQjYSHeRi-wYdEphvp9SsMqXiuvSjZoaKFY6YTOiD1fj2DEhmRzX50AxVfavUp9W80NoFqs_G" + + "qqzraBEDbbOH1t1pIGY42drxr1_6ZZ9jjwQmBj7hjctxM3R--i-SPGMda5_6gWEaAaZl_sm8B1DsKzPT" + + "qVU2JvkJMiWC7EfaErREZ9uAC2IeTqi0"; @Override final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed) diff --git a/src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsZxing.java b/src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsZxing.java index 1fd1cbc91..107b49be4 100644 --- a/src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsZxing.java +++ b/src/net/sourceforge/plantuml/flashcode/FlashCodeUtilsZxing.java @@ -65,7 +65,7 @@ public class FlashCodeUtilsZxing implements FlashCodeUtils { final BitMatrix bit = writer.encode(s, BarcodeFormat.QR_CODE, multiple, hints); return MatrixToImageWriter.toBufferedImage(bit, fore.getRGB() | 0xFF000000, back.getRGB() | 0xFF000000); } catch (WriterException e) { - Log.debug("Cannot create flashcode " + e); + Log.debug("Cannot create qrcode " + e); // e.printStackTrace(); return null; } diff --git a/src/net/sourceforge/plantuml/graphic/QuoteUtils.java b/src/net/sourceforge/plantuml/graphic/QuoteUtils.java index b04adabe1..9492ba8f7 100644 --- a/src/net/sourceforge/plantuml/graphic/QuoteUtils.java +++ b/src/net/sourceforge/plantuml/graphic/QuoteUtils.java @@ -260,7 +260,12 @@ public class QuoteUtils { "Gurer vf ab ceboyrz fb onq lbh pna'g znxr vg jbefr", "Pn p'rfg qh ybheq... Ha gehp qr znynqr.", "V qb abg guvax, gung V guvax.. V guvax.", "Gurer ner cynprf ybjre guna gur onfrzrag", "Gurer ner 10 glcrf bs crbcyr: gubfr jub haqrefgnaq ovanel, naq gubfr jub qba'g.", - "Cyrnfr zvaq gur tnc orgjrra gur genva naq gur cyngsbez"); + "Cyrnfr zvaq gur tnc orgjrra gur genva naq gur cyngsbez", "Nfuvzbgb av tb-puhv xhqnfnv", + "Vs lbh'er erprvivat guvf genafzvffvba, znxr ab nggrzcg gb pbzr gb vgf cbvag bs bevtva.", + "Obl, qb V ungr orvat evtug nyy gur gvzr!", + "Jub funirf gur oneore jub funirf nyy gur zra jub qba'g funir gurzfryirf?", + "V haqrefgnaq uhzna rzbgvbaf, nygubhtu V qb abg srry gurz zlfrys.", + "Lbh qvqa'g fnl gur zntvp jbeq!"); private QuoteUtils() { } diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java b/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java index 6bbe9fd5e..5801b2e02 100644 --- a/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java +++ b/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java @@ -78,7 +78,10 @@ public class TextBlockRecentred extends AbstractTextBlock implements TextBlockBa } public HtmlColor getBackcolor() { - return ((TextBlockBackcolored) textBlock).getBackcolor(); + if (textBlock instanceof TextBlockBackcolored) { + return ((TextBlockBackcolored) textBlock).getBackcolor(); + } + return null; } } \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/graphic/USymbol.java b/src/net/sourceforge/plantuml/graphic/USymbol.java index 096273359..fc836f0b3 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbol.java +++ b/src/net/sourceforge/plantuml/graphic/USymbol.java @@ -57,8 +57,8 @@ public abstract class USymbol { public final static USymbol NODE = record("NODE", SkinParameter.NODE, new USymbolNode()); public final static USymbol ARTIFACT = record("ARTIFACT", SkinParameter.ARTIFACT, new USymbolArtifact()); public final static USymbol PACKAGE = record("PACKAGE", SkinParameter.PACKAGE, new USymbolFolder( - SkinParameter.PACKAGE)); - public final static USymbol FOLDER = record("FOLDER", SkinParameter.FOLDER, new USymbolFolder(SkinParameter.FOLDER)); + SkinParameter.PACKAGE, true)); + public final static USymbol FOLDER = record("FOLDER", SkinParameter.FOLDER, new USymbolFolder(SkinParameter.FOLDER, false)); public final static USymbol FILE = record("FILE", SkinParameter.FILE, new USymbolFile()); public final static USymbol RECTANGLE = record("RECTANGLE", SkinParameter.RECTANGLE, new USymbolRect( SkinParameter.RECTANGLE, HorizontalAlignment.CENTER)); diff --git a/src/net/sourceforge/plantuml/graphic/USymbolFolder.java b/src/net/sourceforge/plantuml/graphic/USymbolFolder.java index 5495d3d9d..d8fd2e22d 100644 --- a/src/net/sourceforge/plantuml/graphic/USymbolFolder.java +++ b/src/net/sourceforge/plantuml/graphic/USymbolFolder.java @@ -58,9 +58,11 @@ public class USymbolFolder extends USymbol { private final static int marginTitleY2 = 3; private final SkinParameter skinParameter; + private final boolean showTitle; - public USymbolFolder(SkinParameter skinParameter) { + public USymbolFolder(SkinParameter skinParameter, boolean showTitle) { this.skinParameter = skinParameter; + this.showTitle = showTitle; } @Override @@ -142,12 +144,15 @@ public class USymbolFolder extends USymbol { final Dimension2D dim = calculateDimension(ug.getStringBounder()); ug = UGraphicStencil.create(ug, getRectangleStencil(dim), new UStroke()); ug = symbolContext.apply(ug); - final Dimension2D dimName = name.calculateDimension(ug.getStringBounder()); + final Dimension2D dimName = showTitle ? name.calculateDimension(ug.getStringBounder()) + : new Dimension2DDouble(40, 15); drawFolder(ug, dim.getWidth(), dim.getHeight(), dimName, symbolContext.isShadowing(), symbolContext.getRoundCorner()); final Margin margin = getMargin(); final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER); - name.drawU(ug.apply(new UTranslate(4, 3))); + if (showTitle) { + name.drawU(ug.apply(new UTranslate(4, 3))); + } tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1() + dimName.getHeight()))); } diff --git a/src/net/sourceforge/plantuml/jdot/CucaDiagramFileMakerJDot.java b/src/net/sourceforge/plantuml/jdot/CucaDiagramFileMakerJDot.java index 41ae5d9aa..341ef613f 100644 --- a/src/net/sourceforge/plantuml/jdot/CucaDiagramFileMakerJDot.java +++ b/src/net/sourceforge/plantuml/jdot/CucaDiagramFileMakerJDot.java @@ -160,10 +160,10 @@ public class CucaDiagramFileMakerJDot implements CucaDiagramFileMaker { private Point2D getCorner(ST_Agnode_s n) { final ST_Agnodeinfo_t data = (ST_Agnodeinfo_t) Macro.AGDATA(n).castTo(ST_Agnodeinfo_t.class); - final double width = data.getDouble("width") * 72; - final double height = data.getDouble("height") * 72; - final double x = data.getStruct("coord").getDouble("x"); - final double y = data.getStruct("coord").getDouble("y"); + final double width = data.width * 72; + final double height = data.height * 72; + final double x = data.coord.x; + final double y = data.coord.y; if (ymirror == null) { return new Point2D.Double(x - width / 2, y - height / 2); diff --git a/src/net/sourceforge/plantuml/jdot/DebugUtils.java b/src/net/sourceforge/plantuml/jdot/DebugUtils.java index 06c4bfa62..c15d402f3 100644 --- a/src/net/sourceforge/plantuml/jdot/DebugUtils.java +++ b/src/net/sourceforge/plantuml/jdot/DebugUtils.java @@ -53,19 +53,19 @@ public class DebugUtils { System.err.println("*********** PRINT EDGE ********** " + getUID(e)); final ST_Agedgeinfo_t data = (ST_Agedgeinfo_t) Macro.AGDATA(e).castTo(ST_Agedgeinfo_t.class); final ST_splines splines = (ST_splines) data.spl; - ST_boxf bb = (ST_boxf) splines.getStruct("bb"); + //ST_boxf bb = (ST_boxf) splines.bb; // final bezier list = (bezier) splines.getPtr("list"); System.err.println("splines.UID=" + ((StarStruct) splines).getUID36()); System.err.println("splines.size=" + splines.size); - System.err.println("bb.LL=" + pointftoString((ST_pointf) bb.getStruct("LL"))); - System.err.println("bb.UR=" + pointftoString((ST_pointf) bb.getStruct("UR"))); - printDebugBezier((ST_bezier) splines.getPtr("list").getPtr()); + //System.err.println("bb.LL=" + pointftoString((ST_pointf) bb.LL)); + //System.err.println("bb.UR=" + pointftoString((ST_pointf) bb.UR)); + printDebugBezier(splines.list.getPtr()); - ST_textlabel_t label = (ST_textlabel_t) data.label; + ST_textlabel_t label = data.label; if (label != null) { - System.err.println("LABEL dimen=" + pointftoString((ST_pointf) label.dimen)); - System.err.println("LABEL space=" + pointftoString((ST_pointf) label.space)); - System.err.println("LABEL pos=" + pointftoString((ST_pointf) label.getStruct("pos"))); + System.err.println("LABEL dimen=" + pointftoString(label.dimen)); + System.err.println("LABEL space=" + pointftoString(label.space)); + System.err.println("LABEL pos=" + pointftoString(label.pos)); } } @@ -76,13 +76,13 @@ public class DebugUtils { public static void printDebugBezier(ST_bezier bezier) { System.err.println("bezier.size=" + bezier.size); - System.err.println("bezier.sflag=" + bezier.getInt("sflag")); - System.err.println("splines.eflag=" + bezier.getInt("eflag")); - System.err.println("bezier.sp=" + pointftoString((ST_pointf) bezier.getStruct("sp"))); - System.err.println("bezier.ep=" + pointftoString((ST_pointf) bezier.getStruct("ep"))); - System.err.println("bezier.list=" + getUID(bezier.getPtr("list"))); + System.err.println("bezier.sflag=" + bezier.sflag); + System.err.println("splines.eflag=" + bezier.eflag); + System.err.println("bezier.sp=" + pointftoString((ST_pointf) bezier.sp)); + System.err.println("bezier.ep=" + pointftoString((ST_pointf) bezier.ep)); + System.err.println("bezier.list=" + getUID(bezier.list.getPtr())); for (int i = 0; i < bezier.size; i++) { - final __ptr__ pt = bezier.getPtr("list").plus(i).getPtr(); + final ST_pointf pt = bezier.list.get(i); System.err.println("pt=" + pointftoString(pt)); } @@ -91,37 +91,27 @@ public class DebugUtils { public static void printDebugNode(ST_Agnode_s n) { System.err.println("*********** PRINT NODE ********** "); final ST_Agnodeinfo_t data = (ST_Agnodeinfo_t) Macro.AGDATA(n).castTo(ST_Agnodeinfo_t.class); - System.err.println("width=" + data.getDouble("width")); - System.err.println("height=" + data.getDouble("height")); - System.err.println("ht=" + data.getDouble("ht")); - System.err.println("lw=" + data.getDouble("lw")); - System.err.println("rw=" + data.getDouble("rw")); - System.err.println("coord=" + pointftoString((ST_pointf) data.getStruct("coord"))); + System.err.println("width=" + data.width); + System.err.println("height=" + data.height); + System.err.println("ht=" + data.ht); + System.err.println("lw=" + data.lw); + System.err.println("rw=" + data.rw); + System.err.println("coord=" + pointftoString((ST_pointf) data.coord)); - ST_boxf bb = (ST_boxf) data.getStruct("bb"); - System.err.println("bb.LL=" + pointftoString((ST_pointf) bb.getStruct("LL"))); - System.err.println("bb.UR=" + pointftoString((ST_pointf) bb.getStruct("UR"))); + //ST_boxf bb = (ST_boxf) data.bb; + //System.err.println("bb.LL=" + pointftoString((ST_pointf) bb.LL)); + //System.err.println("bb.UR=" + pointftoString((ST_pointf) bb.UR)); // TODO Auto-generated method stub } public static String pointftoString(ST_pointf point) { final StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append(point.getDouble("x")); + sb.append(point.x); sb.append(" ; "); - sb.append(point.getDouble("y")); + sb.append(point.y); sb.append(")"); return sb.toString(); } - - public static String pointftoString(__ptr__ point) { - final StringBuilder sb = new StringBuilder(); - sb.append("("); - sb.append(point.getDouble("x")); - sb.append(" ; "); - sb.append(point.getDouble("y")); - sb.append(")"); - return sb.toString(); - } } diff --git a/src/net/sourceforge/plantuml/jdot/JDotPath.java b/src/net/sourceforge/plantuml/jdot/JDotPath.java index 34c99c966..bea0e2f5d 100644 --- a/src/net/sourceforge/plantuml/jdot/JDotPath.java +++ b/src/net/sourceforge/plantuml/jdot/JDotPath.java @@ -75,7 +75,8 @@ public class JDotPath implements UDrawable { private final TextBlock tailLabel; private final Rose rose = new Rose(); - public JDotPath(Link link, ST_Agedge_s edge, YMirror ymirror, CucaDiagram diagram, TextBlock label, TextBlock tailLabel, TextBlock headLabel) { + public JDotPath(Link link, ST_Agedge_s edge, YMirror ymirror, CucaDiagram diagram, TextBlock label, + TextBlock tailLabel, TextBlock headLabel) { this.link = link; this.edge = edge; this.ymirror = ymirror; @@ -138,7 +139,7 @@ public class JDotPath implements UDrawable { private void printDebug(UGraphic ug) { ug = ug.apply(new UChangeColor(HtmlColorUtils.BLUE)).apply(new UChangeBackColor(HtmlColorUtils.BLUE)); final ST_splines splines = getSplines(edge); - final ST_bezier beziers = (ST_bezier) splines.getPtr("list"); + final ST_bezier beziers = splines.list.getPtr(); for (int i = 0; i < beziers.size; i++) { Point2D pt = getPoint(splines, i); if (ymirror != null) { @@ -160,29 +161,36 @@ public class JDotPath implements UDrawable { return null; } final ST_pointf dimen = (ST_pointf) label.dimen; - final ST_pointf space = (ST_pointf)label.space; - final ST_pointf pos = (ST_pointf)label.getStruct("pos"); - final double x = pos.getDouble("x"); - final double y = pos.getDouble("y"); - final double width = dimen.getDouble("x"); - final double height = dimen.getDouble("y"); + final ST_pointf space = (ST_pointf) label.space; + final ST_pointf pos = (ST_pointf) label.pos; + final double x = pos.x; + final double y = pos.y; + final double width = dimen.x; + final double height = dimen.y; return new URectangle(width, height); } private UTranslate getLabelRectangleTranslate(String fieldName) { - //final String fieldName = "label"; + // final String fieldName = "label"; final ST_Agedgeinfo_t data = (ST_Agedgeinfo_t) Macro.AGDATA(edge).castTo(ST_Agedgeinfo_t.class); - ST_textlabel_t label = (ST_textlabel_t) data.getPtr(fieldName); + ST_textlabel_t label = null; + if (fieldName.equals("label")) { + label = data.label; + } else if (fieldName.equals("head_label")) { + label = data.head_label; + } else if (fieldName.equals("tail_label")) { + label = data.tail_label; + } if (label == null) { return null; } - final ST_pointf dimen = (ST_pointf)label.dimen; - final ST_pointf space = (ST_pointf)label.space; - final ST_pointf pos = (ST_pointf)label.getStruct("pos"); - final double x = pos.getDouble("x"); - final double y = pos.getDouble("y"); - final double width = dimen.getDouble("x"); - final double height = dimen.getDouble("y"); + final ST_pointf dimen = (ST_pointf) label.dimen; + final ST_pointf space = (ST_pointf) label.space; + final ST_pointf pos = (ST_pointf) label.pos; + final double x = pos.x; + final double y = pos.y; + final double width = dimen.x; + final double height = dimen.y; if (ymirror == null) { return new UTranslate(x - width / 2, y - height / 2); @@ -225,8 +233,8 @@ public class JDotPath implements UDrawable { private Point2D getPoint(ST_splines splines, int i) { final ST_bezier beziers = (ST_bezier) splines.list.getPtr(); - final __ptr__ pt = beziers.list.get(i); - return new Point2D.Double(pt.getDouble("x"), pt.getDouble("y")); + final ST_pointf pt = beziers.list.get(i); + return new Point2D.Double(pt.x, pt.y); } } diff --git a/src/net/sourceforge/plantuml/preproc/Define.java b/src/net/sourceforge/plantuml/preproc/Define.java index 02fe96a2f..96863fba0 100644 --- a/src/net/sourceforge/plantuml/preproc/Define.java +++ b/src/net/sourceforge/plantuml/preproc/Define.java @@ -38,6 +38,7 @@ package net.sourceforge.plantuml.preproc; import java.util.Iterator; import java.util.List; import java.util.regex.Matcher; +import java.util.regex.Pattern; import net.sourceforge.plantuml.BackSlash; @@ -47,6 +48,7 @@ public class Define { private final String definition; private final String definitionQuoted; private final boolean emptyParentheses; + private Pattern pattern; public Define(String key, List lines, boolean emptyParentheses) { this.emptyParentheses = emptyParentheses; @@ -65,6 +67,7 @@ public class Define { this.definitionQuoted = Matcher.quoteReplacement(definition); } this.signature = new DefineSignature(key, this.definitionQuoted); + } @Override @@ -76,17 +79,44 @@ public class Define { if (definition == null) { return line; } + // if (getFunctionName().indexOf('_') >= 0 && line.indexOf('_') == -1) { + // return line; + // } + if (/* line.length() < getFunctionName().length() || */line.contains(getFunctionName()) == false) { + return line; + } if (signature.isMethod()) { - for (Variables vars : signature.getVariationVariables()) { - line = vars.applyOn(line); + if (line.indexOf('(') == -1) { + return line; } + line = apply1(line); } else { - final String regex = "\\b" + signature.getKey() + "\\b" + (emptyParentheses ? "(\\(\\))?" : ""); - line = BackSlash.translateBackSlashes(line); - line = line.replaceAll(regex, definitionQuoted); - line = BackSlash.untranslateBackSlashes(line); + line = apply2(line); } return line; } + private String apply2(String line) { + if (pattern == null) { + final String regex = "\\b" + signature.getKey() + "\\b" + (emptyParentheses ? "(\\(\\))?" : ""); + pattern = Pattern.compile(regex); + } + + line = BackSlash.translateBackSlashes(line); + line = pattern.matcher(line).replaceAll(definitionQuoted); + line = BackSlash.untranslateBackSlashes(line); + return line; + } + + private String apply1(String line) { + for (Variables vars : signature.getVariationVariables()) { + line = vars.applyOn(line); + } + return line; + } + + public final String getFunctionName() { + return signature.getFonctionName(); + } + } diff --git a/src/net/sourceforge/plantuml/preproc/DefineSignature.java b/src/net/sourceforge/plantuml/preproc/DefineSignature.java index 6952810a7..8fd724900 100644 --- a/src/net/sourceforge/plantuml/preproc/DefineSignature.java +++ b/src/net/sourceforge/plantuml/preproc/DefineSignature.java @@ -45,9 +45,11 @@ public class DefineSignature { private final String key; private final String fonctionName; private final List variables = new ArrayList(); + private final boolean isMethod; public DefineSignature(String key, String definitionQuoted) { this.key = key; + this.isMethod = key.contains("("); final StringTokenizer st = new StringTokenizer(key, "(),"); this.fonctionName = st.nextToken().trim(); @@ -70,7 +72,7 @@ public class DefineSignature { } public boolean isMethod() { - return key.contains("("); + return isMethod; } public String getKey() { @@ -81,4 +83,8 @@ public class DefineSignature { return Collections.unmodifiableList(variables); } + public final String getFonctionName() { + return fonctionName; + } + } diff --git a/src/net/sourceforge/plantuml/preproc/Defines.java b/src/net/sourceforge/plantuml/preproc/Defines.java index 3380efb59..06611b5c8 100644 --- a/src/net/sourceforge/plantuml/preproc/Defines.java +++ b/src/net/sourceforge/plantuml/preproc/Defines.java @@ -37,11 +37,15 @@ package net.sourceforge.plantuml.preproc; import java.io.File; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Date; +import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -63,7 +67,7 @@ public class Defines implements Truth { @Override public String toString() { - return values.keySet().toString(); + return values.keySet().toString() + " " + environment.keySet(); } public static Defines createEmpty() { @@ -80,6 +84,7 @@ public class Defines implements Truth { public void importFrom(Defines other) { this.environment.putAll(other.environment); this.values.putAll(other.values); + magic = null; } public Defines cloneMe() { @@ -111,6 +116,7 @@ public class Defines implements Truth { public void define(String name, List value, boolean emptyParentheses) { values.put(name, new Define(name, value, emptyParentheses)); + magic = null; } public boolean isDefine(String expression) { @@ -134,16 +140,67 @@ public class Defines implements Truth { public void undefine(String name) { values.remove(name); + magic = null; } public List applyDefines(String line) { + // System.err.println("line=" + line + " " + values.size()); line = manageDate(line); line = manageEnvironment(line); - for (Map.Entry ent : values.entrySet()) { - final Define def = ent.getValue(); + line = method1(line); + // line = values.size() < 10 ? method1(line) : method2(line); + return Arrays.asList(line.split("\n")); + } + + private String method1(String line) { + for (Define def : values.values()) { line = def.apply(line); } - return Arrays.asList(line.split("\n")); + return line; + } + + private Map> getAll() { + final Map> result = new LinkedHashMap>(); + for (Define def : values.values()) { + Collection tmp = result.get(def.getFunctionName()); + if (tmp == null) { + tmp = new ArrayList(); + result.put(def.getFunctionName(), tmp); + } + tmp.add(def); + } + return result; + } + + private Map> magic; + + private String method2(String line) { + final Set words = words(line); + if (magic == null) { + magic = getAll(); + + } + for (String w : words) { + Collection tmp = magic.get(w); + if (tmp == null) { + continue; + } + for (Define def : tmp) { + line = def.apply(line); + } + } + return line; + } + + private Set words(String line) { + final String ID = "[A-Za-z_][A-Za-z_0-9]*"; + Pattern p = Pattern.compile(ID); + Matcher m = p.matcher(line); + final Set words = new HashSet(); + while (m.find()) { + words.add(m.group(0)); + } + return words; } private String manageEnvironment(String line) { @@ -176,18 +233,15 @@ public class Defines implements Truth { return line; } - public void saveState() { -// if (savedState.size() > 0) { -// throw new IllegalStateException(); -// } + public void saveState1() { this.savedState.putAll(values); } - public void restoreState() { + public void restoreState1() { this.values.clear(); this.values.putAll(savedState); - + magic = null; } } diff --git a/src/net/sourceforge/plantuml/preproc/IfManager.java b/src/net/sourceforge/plantuml/preproc/IfManager.java index dd1a2e4e6..21e4c0e7c 100644 --- a/src/net/sourceforge/plantuml/preproc/IfManager.java +++ b/src/net/sourceforge/plantuml/preproc/IfManager.java @@ -51,12 +51,12 @@ public class IfManager extends ReadLineInstrumented implements ReadLine { protected static final Pattern2 elsePattern = MyPattern.cmpile("^[%s]*!else[%s]*$"); protected static final Pattern2 endifPattern = MyPattern.cmpile("^[%s]*!endif[%s]*$"); - private final Defines defines; + private final DefinesGet defines; private final ReadLine source; private IfManager child; - public IfManager(ReadLine source, Defines defines) { + public IfManager(ReadLine source, DefinesGet defines) { this.defines = defines; this.source = source; } @@ -96,7 +96,7 @@ public class IfManager extends ReadLineInstrumented implements ReadLine { m = ifdefPattern.matcher(s); if (m.find()) { - boolean ok = defines.isDefine(m.group(2)); + boolean ok = defines.get().isDefine(m.group(2)); if (m.group(1) != null) { ok = !ok; } diff --git a/src/net/sourceforge/plantuml/preproc/IfManagerFilter.java b/src/net/sourceforge/plantuml/preproc/IfManagerFilter.java index 0a65ad817..1d4a7c779 100644 --- a/src/net/sourceforge/plantuml/preproc/IfManagerFilter.java +++ b/src/net/sourceforge/plantuml/preproc/IfManagerFilter.java @@ -42,9 +42,9 @@ import net.sourceforge.plantuml.preproc2.ReadFilter; public class IfManagerFilter implements ReadFilter { - private final Defines defines; + private final DefinesGet defines; - public IfManagerFilter(Defines defines) { + public IfManagerFilter(DefinesGet defines) { this.defines = defines; } diff --git a/src/net/sourceforge/plantuml/preproc/IfManagerNegatif.java b/src/net/sourceforge/plantuml/preproc/IfManagerNegatif.java index 9d42c4c66..0cae93723 100644 --- a/src/net/sourceforge/plantuml/preproc/IfManagerNegatif.java +++ b/src/net/sourceforge/plantuml/preproc/IfManagerNegatif.java @@ -44,7 +44,7 @@ class IfManagerNegatif extends IfManager { private boolean skippingDone = false; - public IfManagerNegatif(ReadLine source, Defines defines) { + public IfManagerNegatif(ReadLine source, DefinesGet defines) { super(source, defines); } diff --git a/src/net/sourceforge/plantuml/preproc/IfManagerPositif.java b/src/net/sourceforge/plantuml/preproc/IfManagerPositif.java index d1102cd4e..e4f3f3af2 100644 --- a/src/net/sourceforge/plantuml/preproc/IfManagerPositif.java +++ b/src/net/sourceforge/plantuml/preproc/IfManagerPositif.java @@ -42,7 +42,7 @@ import net.sourceforge.plantuml.command.regex.Matcher2; class IfManagerPositif extends IfManager { - public IfManagerPositif(ReadLine source, Defines defines) { + public IfManagerPositif(ReadLine source, DefinesGet defines) { super(source, defines); } diff --git a/src/net/sourceforge/plantuml/preproc/Preprocessor.java b/src/net/sourceforge/plantuml/preproc/Preprocessor.java deleted file mode 100644 index c29afcfd6..000000000 --- a/src/net/sourceforge/plantuml/preproc/Preprocessor.java +++ /dev/null @@ -1,93 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.preproc; - -import java.io.File; -import java.io.IOException; -import java.util.Collections; -import java.util.List; -import java.util.Set; - -import net.sourceforge.plantuml.CharSequence2; -import net.sourceforge.plantuml.DefinitionsContainer; - -public class Preprocessor extends ReadLineInstrumented implements ReadLineNumbered { - - private final PreprocessorInclude include; - private final SubPreprocessor subPreprocessor; - private final String description; - - public Sub getSub(String blocname) { - return subPreprocessor.getSub(blocname); - } - - // public Preprocessor(List config, ReadLine reader, String charset, Defines defines, File newCurrentDir, - // DefinitionsContainer definitionsContainer) { - // - // final ReadLine source2 = new IfManager(reader, defines); - // final ReadLineInsertable source3 = new ReadLineInsertable(source2); - // final ReadLine source4 = new PreprocessorDefine(defines, source3); - // this.include = new PreprocessorInclude(config, source4, defines, charset, newCurrentDir, definitionsContainer); - // this.subPreprocessor = new SubPreprocessor(config, charset, defines, definitionsContainer, include); - // } - - public Preprocessor(List config, ReadLine reader, String charset, Defines defines, File newCurrentDir, - DefinitionsContainer definitionsContainer) { - this.description = reader.toString(); - this.include = new PreprocessorInclude(config, reader, defines, charset, newCurrentDir, definitionsContainer); - final ReadLine source2 = new IfManager(include, defines); - final ReadLineInsertable source3 = new ReadLineInsertable(source2); - final ReadLine source4 = new PreprocessorDefine(defines, source3); - this.subPreprocessor = new SubPreprocessor(config, charset, defines, definitionsContainer, source4); - } - - @Override - CharSequence2 readLineInst() throws IOException { - return subPreprocessor.readLine(); - } - - @Override - void closeInst() throws IOException { - // Log.info("Closing preprocessor of " + description); - include.close(); - subPreprocessor.close(); - } - - public Set getFilesUsed() { - return Collections.unmodifiableSet(include.getFilesUsedGlobal()); - } - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/preproc/PreprocessorDefine.java b/src/net/sourceforge/plantuml/preproc/PreprocessorDefine.java deleted file mode 100644 index 13de98495..000000000 --- a/src/net/sourceforge/plantuml/preproc/PreprocessorDefine.java +++ /dev/null @@ -1,201 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.preproc; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import net.sourceforge.plantuml.CharSequence2; -import net.sourceforge.plantuml.CharSequence2Impl; -import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.command.regex.Matcher2; -import net.sourceforge.plantuml.command.regex.MyPattern; -import net.sourceforge.plantuml.command.regex.Pattern2; -import net.sourceforge.plantuml.utils.StartUtils; - -public class PreprocessorDefine extends ReadLineInstrumented implements ReadLine { - - private static final String END_DEFINE_LONG = "!enddefinelong"; - private static final String ID = "[A-Za-z_][A-Za-z_0-9]*"; - private static final String ID_ARG = "\\s*[A-Za-z_][A-Za-z_0-9]*\\s*(?:=\\s*(?:\"[^\"]*\"|'[^']*')\\s*)?"; - private static final String ARG = "(?:\\(" + ID_ARG + "(?:," + ID_ARG + ")*?\\))?"; - private static final Pattern2 definePattern = MyPattern.cmpile("^[%s]*!define[%s]+(" + ID + ARG + ")" - + "(?:[%s]+(.*))?$"); - private static final Pattern2 filenamePattern = MyPattern.cmpile("^[%s]*!filename[%s]+(.+)$"); - private static final Pattern2 undefPattern = MyPattern.cmpile("^[%s]*!undef[%s]+(" + ID + ")$"); - private static final Pattern2 definelongPattern = MyPattern.cmpile("^[%s]*!definelong[%s]+(" + ID + ARG + ")"); - private static final Pattern2 enddefinelongPattern = MyPattern.cmpile("^[%s]*" + END_DEFINE_LONG + "[%s]*$"); - - private final Defines defines; - - private final ReadLineInsertable source; - - public PreprocessorDefine(Defines defines, ReadLineInsertable source) { - this.defines = defines; - this.defines.saveState(); - this.source = source; - } - - @Override - CharSequence2 readLineInst() throws IOException { - final CharSequence2 s = source.readLine(); - if (s == null) { - return null; - } - if (StartUtils.isArobaseStartDiagram(s)) { - this.defines.restoreState(); - } - - Matcher2 m = filenamePattern.matcher(s); - if (m.find()) { - return manageFilename(m); - } - m = definePattern.matcher(s); - if (m.find()) { - return manageDefine(m, s.toString().trim().endsWith("()")); - } - - m = definelongPattern.matcher(s); - if (m.find()) { - return manageDefineLong(m, s.toString().trim().endsWith("()")); - } - - m = undefPattern.matcher(s); - if (m.find()) { - return manageUndef(m); - } - - if (ignoreDefineDuringSeveralLines > 0) { - ignoreDefineDuringSeveralLines--; - return s; - } - - List result = defines.applyDefines(s.toString2()); - if (result.size() > 1) { - result = cleanEndDefineLong(result); - final List inserted = cleanEndDefineLong(result.subList(1, result.size())); - ignoreDefineDuringSeveralLines = inserted.size(); - source.insert(inserted, s.getLocation()); - } - return new CharSequence2Impl(result.get(0), s.getLocation(), s.getPreprocessorError()); - } - - private List cleanEndDefineLong(List data) { - final List result = new ArrayList(); - for (String s : data) { - final String clean = cleanEndDefineLong(s); - if (clean != null) { - result.add(clean); - } - } - return result; - - } - - private String cleanEndDefineLong(String s) { - if (s.trim().startsWith(END_DEFINE_LONG)) { - s = s.trim().substring(END_DEFINE_LONG.length()); - if (s.length() == 0) { - return null; - } - } - return s; - } - - private int ignoreDefineDuringSeveralLines = 0; - - private CharSequence2 manageUndef(Matcher2 m) throws IOException { - defines.undefine(m.group(1)); - return this.readLine(); - } - - private CharSequence2 manageDefineLong(Matcher2 m, boolean emptyParentheses) throws IOException { - final String group1 = m.group(1); - final List def = new ArrayList(); - while (true) { - final CharSequence2 read = this.readLine(); - if (read == null) { - return null; - } - if (enddefinelongPattern.matcher(read).find()) { - defines.define(group1, def, emptyParentheses); - return this.readLine(); - } - def.add(read.toString2()); - } - } - - private CharSequence2 manageFilename(Matcher2 m) throws IOException { - final String group1 = m.group(1); - this.defines.overrideFilename(group1); - return this.readLine(); - } - - private CharSequence2 manageDefine(Matcher2 m, boolean emptyParentheses) throws IOException { - final String group1 = m.group(1); - final String group2 = m.group(2); - if (group2 == null) { - defines.define(group1, null, emptyParentheses); - } else { - final List strings = defines.applyDefines(group2); - if (strings.size() > 1) { - defines.define(group1, strings, emptyParentheses); - } else { - final StringBuilder value = new StringBuilder(strings.get(0)); - while (StringUtils.endsWithBackslash(value.toString())) { - value.setLength(value.length() - 1); - final CharSequence2 read = this.readLine(); - value.append(read.toString2()); - } - final List li = new ArrayList(); - li.add(value.toString()); - defines.define(group1, li, emptyParentheses); - } - } - return this.readLine(); - } - -// public int getLineNumber() { -// return source.getLineNumber(); -// } - - @Override - void closeInst() throws IOException { - source.close(); - } - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/preproc/PreprocessorInclude.java b/src/net/sourceforge/plantuml/preproc/PreprocessorInclude.java deleted file mode 100644 index b14271b14..000000000 --- a/src/net/sourceforge/plantuml/preproc/PreprocessorInclude.java +++ /dev/null @@ -1,370 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * Modified by: Nicolas Jouanin - * - * - */ -package net.sourceforge.plantuml.preproc; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import net.sourceforge.plantuml.AParentFolder; -import net.sourceforge.plantuml.AParentFolderRegular; -import net.sourceforge.plantuml.CharSequence2; -import net.sourceforge.plantuml.DefinitionsContainer; -import net.sourceforge.plantuml.FileSystem; -import net.sourceforge.plantuml.Log; -import net.sourceforge.plantuml.OptionFlags; -import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.command.regex.Matcher2; -import net.sourceforge.plantuml.command.regex.MyPattern; -import net.sourceforge.plantuml.command.regex.Pattern2; -import net.sourceforge.plantuml.utils.StartUtils; - -public class PreprocessorInclude extends ReadLineInstrumented implements ReadLine { - - private static final Pattern2 includeDefPattern = MyPattern.cmpile("^[%s]*!includedef[%s]+[%g]?([^%g]+)[%g]?$"); - private static final Pattern2 includePattern = MyPattern.cmpile("^[%s]*!include[%s]+[%g]?([^%g]+)[%g]?$"); - private static final Pattern2 importPattern = MyPattern.cmpile("^[%s]*!import[%s]+[%g]?([^%g]+)[%g]?$"); - private static final Pattern2 includePatternStdlib = MyPattern.cmpile("^[%s]*!include[%s]+(\\<[^%g]+\\>)$"); - private static final Pattern2 includeManyPattern = MyPattern.cmpile("^[%s]*!include_many[%s]+[%g]?([^%g]+)[%g]?$"); - private static final Pattern2 includeURLPattern = MyPattern.cmpile("^[%s]*!includeurl[%s]+[%g]?([^%g]+)[%g]?$"); - - private final ReadLine reader2; - private final String charset; - private final Defines defines; - private final List config; - private final DefinitionsContainer definitionsContainer; - private final ImportedFiles importedFiles; - - private int numLine = 0; - - private PreprocessorInclude included = null; - - private final AParentFolder oldCurrentDir; - private final Set filesUsedCurrent; - private final Set filesUsedGlobal; - - public PreprocessorInclude(List config, ReadLine reader, Defines defines, String charset, - File newCurrentDir, DefinitionsContainer definitionsContainer) { - this(config, reader, defines, charset, new AParentFolderRegular(newCurrentDir), new HashSet(), - new HashSet(), definitionsContainer, ImportedFiles.createImportedFiles(null)); - throw new UnsupportedOperationException(); - } - - public Set getFilesUsedGlobal() { - return Collections.unmodifiableSet(filesUsedGlobal); - } - - private PreprocessorInclude(List config, ReadLine reader, Defines defines, String charset, - AParentFolder newCurrentDir, Set filesUsedCurrent, Set filesUsedGlobal, - DefinitionsContainer definitionsContainer, ImportedFiles importedFiles) { - this.importedFiles = importedFiles; - this.config = config; - this.defines = defines; - this.charset = charset; - this.reader2 = new ReadLineQuoteComment(reader); - this.definitionsContainer = definitionsContainer; - this.filesUsedCurrent = filesUsedCurrent; - this.filesUsedGlobal = filesUsedGlobal; - if (newCurrentDir == null) { - oldCurrentDir = null; - } else { - oldCurrentDir = importedFiles.getCurrentDir(); - // importedFiles.setCurrentDir(newCurrentDir); - } - throw new UnsupportedOperationException(); - } - - private void restoreCurrentDir() { - throw new UnsupportedOperationException(); -// if (oldCurrentDir != null) { -// importedFiles.setCurrentDir(oldCurrentDir); -// } - } - - @Override - CharSequence2 readLineInst() throws IOException { - final CharSequence2 result = readLineInternal(); - if (result != null && StartUtils.isArobaseStartDiagram(result) && config.size() > 0) { - final List empty = new ArrayList(); - included = new PreprocessorInclude(empty, new ReadLineList(config, result.getLocation()), defines, charset, - null, filesUsedCurrent, filesUsedGlobal, definitionsContainer, importedFiles); - } - if (result != null && (StartUtils.isArobaseEndDiagram(result) || StartUtils.isArobaseStartDiagram(result))) { - // http://plantuml.sourceforge.net/qa/?qa=3389/error-generating-when-same-file-included-different-diagram - filesUsedCurrent.clear(); - } - return result; - } - - private CharSequence2 readLineInternal() throws IOException { - if (included != null) { - final CharSequence2 s = included.readLine(); - if (s != null) { - return s; - } - included.close(); - included = null; - } - - final CharSequence2 s = reader2.readLine(); - numLine++; - if (s == null) { - return null; - } - if (s.getPreprocessorError() == null && OptionFlags.ALLOW_INCLUDE) { - assert included == null; - final Matcher2 m0 = importPattern.matcher(s); - if (m0.find()) { - return manageFileImport(s, m0); - } - final Matcher2 m1 = includePattern.matcher(s); - if (m1.find()) { - return manageFileInclude(s, m1, false); - } - final Matcher2 m2 = includeManyPattern.matcher(s); - if (m2.find()) { - return manageFileInclude(s, m2, true); - } - final Matcher2 m3 = includeDefPattern.matcher(s); - if (m3.find()) { - return manageDefinitionInclude(s, m3); - } - } else { - final Matcher2 m1 = includePatternStdlib.matcher(s); - if (m1.find()) { - return manageFileInclude(s, m1, false); - } - } - final Matcher2 mUrl = includeURLPattern.matcher(s); - if (s.getPreprocessorError() == null && mUrl.find()) { - return manageUrlInclude(s, mUrl); - } - return s; - } - - private CharSequence2 manageFileImport(CharSequence2 s, Matcher2 m) throws IOException { - final String fileName = m.group(1); - final File file = FileSystem.getInstance().getFile(withEnvironmentVariable(fileName)); - if (file.exists() && file.isDirectory() == false) { - importedFiles.add(file); - return this.readLine(); - } - return s.withErrorPreprocessor("Cannot import " + FileWithSuffix.getFileName(file)); - - } - - private CharSequence2 manageUrlInclude(CharSequence2 s, Matcher2 m) throws IOException { - String urlString = m.group(1); - urlString = defines.applyDefines(urlString).get(0); - // - final int idx = urlString.lastIndexOf('!'); - String suf = null; - if (idx != -1) { - suf = urlString.substring(idx + 1); - urlString = urlString.substring(0, idx); - } - try { - if (urlString.toLowerCase().startsWith("https://") == false - && urlString.toLowerCase().startsWith("http://") == false) { - return s.withErrorPreprocessor("Cannot include url " + urlString); - } - final URL url = new URL(urlString); - included = new PreprocessorInclude(config, getReaderInclude(url, s, suf), defines, charset, null, - filesUsedCurrent, filesUsedGlobal, definitionsContainer, importedFiles); - } catch (MalformedURLException e) { - return s.withErrorPreprocessor("Cannot include url " + urlString); - } - return this.readLine(); - } - - private CharSequence2 manageDefinitionInclude(CharSequence2 s, Matcher2 matcher) throws IOException { - final String definitionName = matcher.group(1); - final List definition = definitionsContainer.getDefinition(definitionName); - included = new PreprocessorInclude(config, new ReadLineList(definition, s.getLocation()), defines, charset, - null, filesUsedCurrent, filesUsedGlobal, definitionsContainer, importedFiles); - return this.readLine(); - } - - private CharSequence2 manageFileInclude(CharSequence2 s, Matcher2 matcher, boolean allowMany) throws IOException { - String fileName = matcher.group(1); - fileName = defines.applyDefines(fileName).get(0); - if (fileName.startsWith("<") && fileName.endsWith(">")) { - final ReadLine strlibReader = getReaderStdlibInclude(s, fileName.substring(1, fileName.length() - 1)); - if (strlibReader == null) { - return s.withErrorPreprocessor("Cannot include " + fileName); - } - included = new PreprocessorInclude(config, strlibReader, defines, charset, null, filesUsedCurrent, - filesUsedGlobal, definitionsContainer, importedFiles); - return this.readLine(); - } - final int idx = fileName.lastIndexOf('!'); - String suf = null; - if (idx != -1) { - suf = fileName.substring(idx + 1); - fileName = fileName.substring(0, idx); - } - // final File f = FileSystem.getInstance().getFile(withEnvironmentVariable(fileName)); - final FileWithSuffix f2 = new FileWithSuffix(importedFiles, withEnvironmentVariable(fileName), suf); - if (f2.fileOk() == false) { - return s.withErrorPreprocessor("Cannot include " + f2.getDescription()); - } else if (allowMany == false && filesUsedCurrent.contains(f2)) { - // return CharSequence2Impl.errorPreprocessor("File already included " + f.getAbsolutePath(), lineLocation); - return this.readLine(); - } - filesUsedCurrent.add(f2); - filesUsedGlobal.add(f2); - included = new PreprocessorInclude(config, getReaderInclude(f2, s), defines, charset, f2.getParentFile(), - filesUsedCurrent, filesUsedGlobal, definitionsContainer, importedFiles); - return this.readLine(); - } - - public static String withEnvironmentVariable(String s) { - final Pattern p = Pattern.compile("%(\\w+)%"); - - final Matcher m = p.matcher(s); - final StringBuffer sb = new StringBuffer(); - while (m.find()) { - final String var = m.group(1); - final String value = getenv(var); - if (value != null) { - m.appendReplacement(sb, Matcher.quoteReplacement(value)); - } - } - m.appendTail(sb); - s = sb.toString(); - return s; - } - - public static String getenv(String var) { - final String env = System.getProperty(var); - if (StringUtils.isNotEmpty(env)) { - return StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(env); - } - final String getenv = System.getenv(var); - if (StringUtils.isNotEmpty(getenv)) { - return StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(getenv); - } - return null; - } - - private InputStream getStdlibInputStream(String filename) { - final InputStream result = Stdlib.getResourceAsStream(filename); - // Log.info("Loading sdlib " + filename + " ok"); - return result; - } - - private ReadLine getReaderStdlibInclude(CharSequence2 s, String filename) { - Log.info("Loading sdlib " + filename); - InputStream is = getStdlibInputStream(filename); - if (is == null) { - return null; - } - final String description = "<" + filename + ">"; - try { - if (StartDiagramExtractReader.containsStartDiagram(is, s, description)) { - is = getStdlibInputStream(filename); - return StartDiagramExtractReader.build(is, s, description); - } - is = getStdlibInputStream(filename); - if (is == null) { - return null; - } - return ReadLineReader.create(new InputStreamReader(is), description); - } catch (IOException e) { - e.printStackTrace(); - return new ReadLineSimple(s, e.toString()); - } - } - - private ReadLine getReaderInclude(FileWithSuffix f2, CharSequence2 s) { - try { - if (StartDiagramExtractReader.containsStartDiagram(f2, s, charset)) { - return StartDiagramExtractReader.build(f2, s, charset); - } - final Reader reader = f2.getReader(charset); - if (reader == null) { - return new ReadLineSimple(s, "Cannot open " + f2.getDescription()); - } - return ReadLineReader.create(reader, f2.getDescription(), s.getLocation()); - } catch (IOException e) { - e.printStackTrace(); - return new ReadLineSimple(s, e.toString()); - } - - } - - private ReadLine getReaderInclude(final URL url, CharSequence2 s, String suf) { - try { - if (StartDiagramExtractReader.containsStartDiagram(url, s, charset)) { - return StartDiagramExtractReader.build(url, s, suf, charset); - } - final InputStream is = url.openStream(); - if (charset == null) { - Log.info("Using default charset"); - return ReadLineReader.create(new InputStreamReader(is), url.toString(), s.getLocation()); - } - Log.info("Using charset " + charset); - return ReadLineReader.create(new InputStreamReader(is, charset), url.toString(), s.getLocation()); - } catch (IOException e) { - e.printStackTrace(); - return new ReadLineSimple(s, e.toString()); - } - - } - - public int getLineNumber() { - return numLine; - } - - @Override - void closeInst() throws IOException { - restoreCurrentDir(); - reader2.close(); - } - -} diff --git a/src/net/sourceforge/plantuml/preproc/ReadLineConcat.java b/src/net/sourceforge/plantuml/preproc/ReadLineConcat.java deleted file mode 100644 index 4ebfa0a01..000000000 --- a/src/net/sourceforge/plantuml/preproc/ReadLineConcat.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.preproc; - -import java.io.IOException; - -import net.sourceforge.plantuml.CharSequence2; - -public class ReadLineConcat implements ReadLine { - - private ReadLine file1; - final private ReadLine file2; - - public ReadLineConcat(ReadLine file1, ReadLine file2) { - this.file1 = file1; - this.file2 = file2; - } - - public void close() throws IOException { - if (file1 != null) { - throw new IllegalStateException(); - } - file2.close(); - } - - public CharSequence2 readLine() throws IOException { - CharSequence2 result = null; - if (file1 != null) { - result = file1.readLine(); - if (result == null) { - file1.close(); - file1 = null; - } - return readLine(); - } - return file2.readLine(); - } - -} diff --git a/src/net/sourceforge/plantuml/preproc/ReadLineInsertable.java b/src/net/sourceforge/plantuml/preproc/ReadLineInsertable.java deleted file mode 100644 index e5980b270..000000000 --- a/src/net/sourceforge/plantuml/preproc/ReadLineInsertable.java +++ /dev/null @@ -1,80 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.preproc; - -import java.io.IOException; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; - -import net.sourceforge.plantuml.CharSequence2; -import net.sourceforge.plantuml.CharSequence2Impl; -import net.sourceforge.plantuml.LineLocation; - -class ReadLineInsertable implements ReadLine { - - private final ReadLine source; - private final List inserted = new LinkedList(); - - public ReadLineInsertable(ReadLine source) { - this.source = source; - } - - public void close() throws IOException { - source.close(); - } - - public CharSequence2 readLine() throws IOException { - if (inserted.size() > 0) { - final Iterator it = inserted.iterator(); - final CharSequence2 result = it.next(); - it.remove(); - return result; - } - return source.readLine(); - } - - public void insert(List data, LineLocation location) { - for (CharSequence s : data) { - insert(s, location); - } - } - - public void insert(CharSequence s, LineLocation location) { - inserted.add(new CharSequence2Impl(s, location)); - } - -} diff --git a/src/net/sourceforge/plantuml/preproc/ReadLineQuoteComment.java b/src/net/sourceforge/plantuml/preproc/ReadLineQuoteComment.java deleted file mode 100644 index 60e2979f1..000000000 --- a/src/net/sourceforge/plantuml/preproc/ReadLineQuoteComment.java +++ /dev/null @@ -1,86 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.preproc; - -import java.io.IOException; - -import net.sourceforge.plantuml.CharSequence2; -import net.sourceforge.plantuml.CharSequence2Impl; - -public class ReadLineQuoteComment extends ReadLineInstrumented implements ReadLine { - - private final ReadLine raw; - private boolean longComment = false; - - public ReadLineQuoteComment(ReadLine source) { - this.raw = source; - } - - @Override - void closeInst() throws IOException { - raw.close(); - } - - @Override - CharSequence2 readLineInst() throws IOException { - while (true) { - final CharSequence2 result = raw.readLine(); - if (result == null) { - return null; - } - final String trim = result.toString().replace('\t', ' ').trim(); - if (this.longComment && trim.endsWith("'/")) { - this.longComment = false; - continue; - } - if (this.longComment) { - continue; - } - if (trim.startsWith("'")) { - continue; - } - if (trim.startsWith("/'") && trim.endsWith("'/")) { - continue; - } - if (trim.startsWith("/'") && trim.contains("'/") == false) { - this.longComment = true; - continue; - } - return ((CharSequence2Impl) result).removeInnerComment(); - } - } - -} diff --git a/src/net/sourceforge/plantuml/preproc/SubPreprocessor.java b/src/net/sourceforge/plantuml/preproc/SubPreprocessor.java deleted file mode 100644 index 056c9efe3..000000000 --- a/src/net/sourceforge/plantuml/preproc/SubPreprocessor.java +++ /dev/null @@ -1,185 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.preproc; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import net.sourceforge.plantuml.CharSequence2; -import net.sourceforge.plantuml.DefinitionsContainer; -import net.sourceforge.plantuml.FileSystem; -import net.sourceforge.plantuml.Log; -import net.sourceforge.plantuml.command.regex.Matcher2; -import net.sourceforge.plantuml.command.regex.MyPattern; -import net.sourceforge.plantuml.command.regex.Pattern2; - -public class SubPreprocessor extends ReadLineInstrumented implements ReadLine { - - private static final String ID = "[A-Za-z_][A-Za-z_0-9]*"; - - private static final Pattern2 includeSubPattern = MyPattern.cmpile("^[%s]*!includesub[%s]+[%g]?([^%g]+)[%g]?$"); - - private static final Pattern2 startsub = MyPattern.cmpile("^[%s]*!startsub[%s]+(" + ID + ")"); - private static final Pattern2 endsub = MyPattern.cmpile("^[%s]*!endsub[%s]*"); - - private final ReadLine source; - private final Defines defines; - private final DefinitionsContainer definitionsContainer; - private final String charset; - private final Map subs = new HashMap(); - private final List config; - private Sub learningSub; - private ReadLine includedSub; - - public SubPreprocessor(List config, String charset, Defines defines, - DefinitionsContainer definitionsContainer, ReadLine source) { - this.config = config; - this.source = source; - this.charset = charset; - this.defines = defines; - this.definitionsContainer = definitionsContainer; - } - - @Override - CharSequence2 readLineInst() throws IOException { - if (includedSub != null) { - final CharSequence2 s = includedSub.readLine(); - if (s != null) { - eventuallyLearn(s); - return s; - } - includedSub = null; - } - - final CharSequence2 s = source.readLine(); - if (s == null) { - return null; - } - - final Matcher2 m1 = includeSubPattern.matcher(s); - if (m1.find()) { - return manageIncludeSub(s, m1); - } - - Matcher2 m = startsub.matcher(s); - if (m.find()) { - return manageStartsub(m); - } - - m = endsub.matcher(s); - if (m.find()) { - return manageEndsub(m); - } - eventuallyLearn(s); - return s; - } - - private void eventuallyLearn(final CharSequence2 s) { - if (learningSub != null) { - learningSub.add(s); - } - } - - private CharSequence2 manageIncludeSub(CharSequence2 s, Matcher2 m) throws IOException { - final String name = m.group(1); - final int idx = name.indexOf('!'); - if (idx != -1) { - final String filename = name.substring(0, idx); - final String blocname = name.substring(idx + 1); - final File f = FileSystem.getInstance().getFile(PreprocessorInclude.withEnvironmentVariable(filename)); - if (f.exists() == false || f.isDirectory()) { - return s.withErrorPreprocessor("Cannot include " + FileWithSuffix.getFileName(f)); - } - final Preprocessor data = new Preprocessor(config, getReaderInclude(s, f), charset, defines, null, - definitionsContainer); - while (data.readLine() != null) { - // Read file - } - data.close(); - this.includedSub = data.getSub(blocname).getReadLine(s.getLocation()); - } else { - this.includedSub = getSub(name).getReadLine(s.getLocation()); - } - return this.readLine(); - } - - private ReadLine getReaderInclude(CharSequence2 s, final File f) { - try { - if (charset == null) { - Log.info("Using default charset"); - return ReadLineReader.create(new FileReader(f), FileWithSuffix.getFileName(f), s.getLocation()); - } - Log.info("Using charset " + charset); - return ReadLineReader.create(new InputStreamReader(new FileInputStream(f), charset), FileWithSuffix.getFileName(f), - s.getLocation()); - } catch (IOException e) { - return new ReadLineSimple(s, e.toString()); - } - - } - - private CharSequence2 manageStartsub(Matcher2 m) throws IOException { - final String name = m.group(1); - this.learningSub = getSub(name); - return this.readLine(); - } - - private CharSequence2 manageEndsub(Matcher2 m) throws IOException { - this.learningSub = null; - return this.readLine(); - } - - Sub getSub(String name) { - Sub result = subs.get(name); - if (result == null) { - result = new Sub(name); - subs.put(name, result); - } - return result; - } - - @Override - void closeInst() throws IOException { - source.close(); - } - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/preproc2/Preprocessor2.java b/src/net/sourceforge/plantuml/preproc2/Preprocessor2.java index a91fe1690..9463fef1b 100644 --- a/src/net/sourceforge/plantuml/preproc2/Preprocessor2.java +++ b/src/net/sourceforge/plantuml/preproc2/Preprocessor2.java @@ -41,10 +41,10 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import net.sourceforge.plantuml.AParentFolder; import net.sourceforge.plantuml.CharSequence2; import net.sourceforge.plantuml.DefinitionsContainer; import net.sourceforge.plantuml.preproc.Defines; +import net.sourceforge.plantuml.preproc.DefinesGet; import net.sourceforge.plantuml.preproc.FileWithSuffix; import net.sourceforge.plantuml.preproc.IfManagerFilter; import net.sourceforge.plantuml.preproc.ImportedFiles; @@ -58,13 +58,15 @@ public class Preprocessor2 implements ReadLineNumbered { public Preprocessor2(List config, ReadLine reader, String charset, Defines defines, DefinitionsContainer definitionsContainer, ImportedFiles importedFiles) throws IOException { - this(config, reader, charset, defines, definitionsContainer, new HashSet(), importedFiles); + this(config, reader, charset, new DefinesGet(defines), definitionsContainer, new HashSet(), + importedFiles); } - Preprocessor2(List config, ReadLine reader, String charset, Defines defines, + Preprocessor2(List config, ReadLine reader, String charset, DefinesGet defines, DefinitionsContainer definitionsContainer, Set filesUsedGlobal, ImportedFiles importedFiles) throws IOException { final ReadFilterAnd2 filters = new ReadFilterAnd2(); + defines.saveState(); filters.add(new ReadLineQuoteComment2()); include = new PreprocessorInclude3(config, charset, defines, definitionsContainer, importedFiles, @@ -72,7 +74,7 @@ public class Preprocessor2 implements ReadLineNumbered { filters.add(new ReadLineAddConfig2(config)); filters.add(new IfManagerFilter(defines)); filters.add(new PreprocessorDefine4Apply(defines)); - filters.add(new SubPreprocessor2(charset, defines, definitionsContainer)); + filters.add(new SubPreprocessor2(charset, definitionsContainer)); filters.add(new PreprocessorDefine3Learner(defines)); filters.add(include); diff --git a/src/net/sourceforge/plantuml/preproc2/PreprocessorDefine3Learner.java b/src/net/sourceforge/plantuml/preproc2/PreprocessorDefine3Learner.java index 5e54e18d8..9c17bc237 100644 --- a/src/net/sourceforge/plantuml/preproc2/PreprocessorDefine3Learner.java +++ b/src/net/sourceforge/plantuml/preproc2/PreprocessorDefine3Learner.java @@ -45,6 +45,7 @@ import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.command.regex.Pattern2; import net.sourceforge.plantuml.preproc.Defines; +import net.sourceforge.plantuml.preproc.DefinesGet; import net.sourceforge.plantuml.preproc.ReadLine; import net.sourceforge.plantuml.utils.StartUtils; @@ -61,11 +62,10 @@ public class PreprocessorDefine3Learner implements ReadFilter { private static final Pattern2 definelongPattern = MyPattern.cmpile("^[%s]*!definelong[%s]+(" + ID + ARG + ")"); private static final Pattern2 enddefinelongPattern = MyPattern.cmpile("^[%s]*" + END_DEFINE_LONG + "[%s]*$"); - private final Defines defines; + private final DefinesGet defines; - public PreprocessorDefine3Learner(Defines defines) { + public PreprocessorDefine3Learner(DefinesGet defines) { this.defines = defines; - this.defines.saveState(); } public static boolean isLearningLine(CharSequence2 s) { @@ -129,59 +129,8 @@ public class PreprocessorDefine3Learner implements ReadFilter { }; } - - // private final ReadLineInsertable source; - // - // public PreprocessorDefine2(Defines defines, ReadLineInsertable source) { - // this.defines = defines; - // this.defines.saveState(); - // this.source = source; - // } - // - // @Override - // CharSequence2 readLineInst() throws IOException { - // - // if (ignoreDefineDuringSeveralLines > 0) { - // ignoreDefineDuringSeveralLines--; - // return s; - // } - // - // List result = defines.applyDefines(s.toString2()); - // if (result.size() > 1) { - // result = cleanEndDefineLong(result); - // final List inserted = cleanEndDefineLong(result.subList(1, result.size())); - // ignoreDefineDuringSeveralLines = inserted.size(); - // source.insert(inserted, s.getLocation()); - // } - // return new CharSequence2Impl(result.get(0), s.getLocation(), s.getPreprocessorError()); - // } - - private List cleanEndDefineLong(List data) { - final List result = new ArrayList(); - for (String s : data) { - final String clean = cleanEndDefineLong(s); - if (clean != null) { - result.add(clean); - } - } - return result; - - } - - private String cleanEndDefineLong(String s) { - if (s.trim().startsWith(END_DEFINE_LONG)) { - s = s.trim().substring(END_DEFINE_LONG.length()); - if (s.length() == 0) { - return null; - } - } - return s; - } - - // private int ignoreDefineDuringSeveralLines = 0; - private void manageUndef(Matcher2 m) throws IOException { - defines.undefine(m.group(1)); + defines.get().undefine(m.group(1)); } private void manageDefineLong(ReadLine source, Matcher2 m, boolean emptyParentheses) throws IOException { @@ -193,7 +142,7 @@ public class PreprocessorDefine3Learner implements ReadFilter { return; } if (enddefinelongPattern.matcher(read).find()) { - defines.define(group1, def, emptyParentheses); + defines.get().define(group1, def, emptyParentheses); return; } def.add(read.toString2()); @@ -202,18 +151,18 @@ public class PreprocessorDefine3Learner implements ReadFilter { private void manageFilename(Matcher2 m) { final String group1 = m.group(1); - this.defines.overrideFilename(group1); + this.defines.get().overrideFilename(group1); } private void manageDefine(ReadLine source, Matcher2 m, boolean emptyParentheses) throws IOException { final String group1 = m.group(1); final String group2 = m.group(2); if (group2 == null) { - defines.define(group1, null, emptyParentheses); + defines.get().define(group1, null, emptyParentheses); } else { - final List strings = defines.applyDefines(group2); + final List strings = defines.get().applyDefines(group2); if (strings.size() > 1) { - defines.define(group1, strings, emptyParentheses); + defines.get().define(group1, strings, emptyParentheses); } else { final StringBuilder value = new StringBuilder(strings.get(0)); while (StringUtils.endsWithBackslash(value.toString())) { @@ -223,19 +172,9 @@ public class PreprocessorDefine3Learner implements ReadFilter { } final List li = new ArrayList(); li.add(value.toString()); - defines.define(group1, li, emptyParentheses); + defines.get().define(group1, li, emptyParentheses); } } } - - // // public int getLineNumber() { - // // return source.getLineNumber(); - // // } - // - // @Override - // void closeInst() throws IOException { - // source.close(); - // } - } \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/preproc2/PreprocessorDefine4Apply.java b/src/net/sourceforge/plantuml/preproc2/PreprocessorDefine4Apply.java index c96d71ce5..f74a265d7 100644 --- a/src/net/sourceforge/plantuml/preproc2/PreprocessorDefine4Apply.java +++ b/src/net/sourceforge/plantuml/preproc2/PreprocessorDefine4Apply.java @@ -40,15 +40,15 @@ import java.util.List; import net.sourceforge.plantuml.CharSequence2; import net.sourceforge.plantuml.CharSequence2Impl; -import net.sourceforge.plantuml.preproc.Defines; +import net.sourceforge.plantuml.preproc.DefinesGet; import net.sourceforge.plantuml.preproc.ReadLine; import net.sourceforge.plantuml.preproc.ReadLineList; public class PreprocessorDefine4Apply implements ReadFilter { - private final Defines defines; + private final DefinesGet defines; - public PreprocessorDefine4Apply(Defines defines) throws IOException { + public PreprocessorDefine4Apply(DefinesGet defines) throws IOException { this.defines = defines; } @@ -78,7 +78,7 @@ public class PreprocessorDefine4Apply implements ReadFilter { if (PreprocessorDefine3Learner.isLearningLine(s)) { return s; } - final List result = defines.applyDefines(s.toString2()); + final List result = defines.get().applyDefines(s.toString2()); if (result.size() > 1) { insert(new ReadLineList(result, s.getLocation())); return readLine(); @@ -89,58 +89,4 @@ public class PreprocessorDefine4Apply implements ReadFilter { } - // private final ReadLine2 source; - // // private final List result = new ArrayList(); - // // private final PreprocessorDefine2 preprocDefines; - // private final Defines defines; - // - // private final PreprocessorInclude2 include; - // - // // private final SubPreprocessor2 subPreprocessor2; - // - // public PreprocessorDefine4Apply(List config, ReadLine reader, String charset, Defines defines, File - // newCurrentDir, - // DefinitionsContainer definitionsContainer) throws IOException { - // // final IfManager tmp1 = new IfManager(new ReadLineQuoteComment(reader), defines); - // final ReadFilter addConfig = new ReadLineAddConfig2(config); - // final ReadFilter filterComment = new ReadLineQuoteComment2(); - // final ReadFilter filterIf = new IfManagerFilter(defines); - // final ReadFilter filterSub = new SubPreprocessor2(charset, defines, definitionsContainer); - // final ReadFilter filterLearnDefine = new PreprocessorDefine3Learner(defines); - // this.source = new ReadLine2Adapter(new ReadFilterAnd(addConfig, filterIf).applyFilter(reader), - // new ReadFilterAnd(filterSub, filterComment, filterLearnDefine)); - // this.defines = defines; - // // this.preprocDefines = new PreprocessorDefine2(defines); - // this.include = new PreprocessorInclude2(charset); - // // this.subPreprocessor2 = new SubPreprocessor2(charset, defines, definitionsContainer); - // } - // - // public CharSequence2 readLine() throws IOException { - // while (true) { - // // this.preprocDefines.learnDefinition(this.source); - // if (this.include.learnInclude(this.source)) { - // continue; - // } - // // if (this.subPreprocessor2.learn(this.source)) { - // // continue; - // // } - // - // final CharSequence2 s = this.source.readLine(); - // if (s == null) { - // return null; - // } - // String tmp = manageDefines(s, source); - // if (tmp != null) { - // return new CharSequence2Impl(tmp, s.getLocation(), s.getPreprocessorError()); - // } - // } - // } - // public void close() throws IOException { - // this.source.close(); - // } - // - // public Set getFilesUsed() { - // System.err.println("************************** WARNING **************************"); - // return Collections.emptySet(); - // } } \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/preproc2/PreprocessorInclude3.java b/src/net/sourceforge/plantuml/preproc2/PreprocessorInclude3.java index 199c8c3c2..a3a047422 100644 --- a/src/net/sourceforge/plantuml/preproc2/PreprocessorInclude3.java +++ b/src/net/sourceforge/plantuml/preproc2/PreprocessorInclude3.java @@ -59,9 +59,11 @@ import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.command.regex.Pattern2; import net.sourceforge.plantuml.preproc.Defines; +import net.sourceforge.plantuml.preproc.DefinesGet; import net.sourceforge.plantuml.preproc.FileWithSuffix; import net.sourceforge.plantuml.preproc.ImportedFiles; import net.sourceforge.plantuml.preproc.ReadLine; +import net.sourceforge.plantuml.preproc.ReadLineEmpty; import net.sourceforge.plantuml.preproc.ReadLineList; import net.sourceforge.plantuml.preproc.ReadLineReader; import net.sourceforge.plantuml.preproc.ReadLineSimple; @@ -73,22 +75,28 @@ import net.sourceforge.plantuml.utils.StartUtils; public class PreprocessorInclude3 implements ReadFilter { private static final Pattern2 includeDefPattern = MyPattern.cmpile("^[%s]*!includedef[%s]+[%g]?([^%g]+)[%g]?$"); + + private static final Pattern2 includeDefaultStrategy = MyPattern.cmpile("^[%s]*!default_include[%s]+(once|many)$"); + private static final Pattern2 includePattern = MyPattern.cmpile("^[%s]*!include[%s]+[%g]?([^%g]+)[%g]?$"); + private static final Pattern2 includeManyPattern = MyPattern.cmpile("^[%s]*!include_many[%s]+[%g]?([^%g]+)[%g]?$"); + private static final Pattern2 includeOncePattern = MyPattern.cmpile("^[%s]*!include_once[%s]+[%g]?([^%g]+)[%g]?$"); + private static final Pattern2 importPattern = MyPattern.cmpile("^[%s]*!import[%s]+[%g]?([^%g]+)[%g]?$"); private static final Pattern2 includePatternStdlib = MyPattern.cmpile("^[%s]*!include[%s]+(\\<[^%g]+\\>)$"); - private static final Pattern2 includeManyPattern = MyPattern.cmpile("^[%s]*!include_many[%s]+[%g]?([^%g]+)[%g]?$"); private static final Pattern2 includeURLPattern = MyPattern.cmpile("^[%s]*!includeurl[%s]+[%g]?([^%g]+)[%g]?$"); private final String charset; - private final Defines defines; + private final DefinesGet defines; private final List config; private final DefinitionsContainer definitionsContainer; private final ImportedFiles importedFiles; private final Set filesUsedCurrent = new HashSet(); private final Set filesUsedGlobal; + private PreprocessorIncludeStrategy strategy = PreprocessorIncludeStrategy.ONCE; - public PreprocessorInclude3(List config, String charset, Defines defines, + public PreprocessorInclude3(List config, String charset, DefinesGet defines, DefinitionsContainer definitionsContainer, ImportedFiles importedFiles, Set filesUsedGlobal) { this.charset = charset; this.config = config; @@ -121,9 +129,10 @@ public class PreprocessorInclude3 implements ReadFilter { if (s == null || s.getPreprocessorError() != null) { return s; } - if (s != null && (StartUtils.isArobaseEndDiagram(s) || StartUtils.isArobaseStartDiagram(s))) { + if (s != null && StartUtils.startOrEnd(s)) { // http://plantuml.sourceforge.net/qa/?qa=3389/error-generating-when-same-file-included-different-diagram filesUsedCurrent.clear(); + strategy = PreprocessorIncludeStrategy.ONCE; return s; } if (s.getPreprocessorError() == null && OptionFlags.ALLOW_INCLUDE) { @@ -137,23 +146,28 @@ public class PreprocessorInclude3 implements ReadFilter { } final Matcher2 m1 = includePattern.matcher(s); if (m1.find()) { - insert(manageFileInclude(s, m1, false)); + insert(manageFileInclude(s, m1, strategy)); return readLine(); } final Matcher2 m2 = includeManyPattern.matcher(s); if (m2.find()) { - insert(manageFileInclude(s, m2, true)); + insert(manageFileInclude(s, m2, PreprocessorIncludeStrategy.MANY)); return readLine(); } - final Matcher2 m3 = includeDefPattern.matcher(s); + final Matcher2 m3 = includeOncePattern.matcher(s); if (m3.find()) { - insert(manageDefinitionInclude(s, m3)); + insert(manageFileInclude(s, m3, PreprocessorIncludeStrategy.ONCE)); + return readLine(); + } + final Matcher2 m4 = includeDefPattern.matcher(s); + if (m4.find()) { + insert(manageDefinitionInclude(s, m4)); return readLine(); } } else { final Matcher2 m1 = includePatternStdlib.matcher(s); if (m1.find()) { - insert(manageFileInclude(s, m1, false)); + insert(manageFileInclude(s, m1, PreprocessorIncludeStrategy.ONCE)); return readLine(); } } @@ -162,6 +176,11 @@ public class PreprocessorInclude3 implements ReadFilter { insert(manageUrlInclude(s, mUrl)); return readLine(); } + final Matcher2 m2 = includeDefaultStrategy.matcher(s); + if (m2.find()) { + strategy = PreprocessorIncludeStrategy.fromString(m2.group(1)); + return readLine(); + } return s; } @@ -181,7 +200,7 @@ public class PreprocessorInclude3 implements ReadFilter { private ReadLine manageUrlInclude(CharSequence2 s, Matcher2 m) throws IOException { String urlString = m.group(1); - urlString = defines.applyDefines(urlString).get(0); + urlString = defines.get().applyDefines(urlString).get(0); final int idx = urlString.lastIndexOf('!'); String suf = null; @@ -210,9 +229,10 @@ public class PreprocessorInclude3 implements ReadFilter { definitionsContainer, filesUsedGlobal, importedFiles); } - private ReadLine manageFileInclude(CharSequence2 s, Matcher2 matcher, boolean allowMany) throws IOException { + private ReadLine manageFileInclude(CharSequence2 s, Matcher2 matcher, PreprocessorIncludeStrategy allowMany) + throws IOException { String fileName = matcher.group(1); - fileName = defines.applyDefines(fileName).get(0); + fileName = defines.get().applyDefines(fileName).get(0); if (fileName.startsWith("<") && fileName.endsWith(">")) { final ReadLine strlibReader = getReaderStdlibInclude(s, fileName.substring(1, fileName.length() - 1)); if (strlibReader == null) { @@ -232,8 +252,9 @@ public class PreprocessorInclude3 implements ReadFilter { Log.error("Current path is " + FileWithSuffix.getAbsolutePath(new File("."))); Log.error("Cannot include " + f2.getDescription()); return new ReadLineSingle(s.withErrorPreprocessor("Cannot include " + f2.getDescription())); - } else if (allowMany == false && filesUsedCurrent.contains(f2)) { - return new ReadLineSimple(s, "File already included " + f2.getDescription()); + } else if (allowMany == PreprocessorIncludeStrategy.ONCE && filesUsedCurrent.contains(f2)) { + // return new ReadLineSimple(s, "File already included " + f2.getDescription()); + return new ReadLineEmpty(); } filesUsedCurrent.add(f2); filesUsedGlobal.add(f2); @@ -242,7 +263,7 @@ public class PreprocessorInclude3 implements ReadFilter { filesUsedGlobal, importedFiles.withCurrentDir(f2.getParentFile())); } - static String withEnvironmentVariable(String s) { + public static String withEnvironmentVariable(String s) { final Pattern p = Pattern.compile("%(\\w+)%"); final Matcher m = p.matcher(s); diff --git a/src/net/sourceforge/plantuml/preproc2/ReadLineAddConfig.java b/src/net/sourceforge/plantuml/preproc2/ReadLineAddConfig.java deleted file mode 100644 index aac1700b9..000000000 --- a/src/net/sourceforge/plantuml/preproc2/ReadLineAddConfig.java +++ /dev/null @@ -1,79 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.preproc2; - -import java.io.IOException; -import java.util.List; - -import net.sourceforge.plantuml.CharSequence2; -import net.sourceforge.plantuml.preproc.ReadLine; -import net.sourceforge.plantuml.preproc.ReadLineList; -import net.sourceforge.plantuml.utils.StartUtils; - -public class ReadLineAddConfig implements ReadLine { - - private ReadLine inserted; - private final ReadLine raw; - private final List config; - - public ReadLineAddConfig(List config, ReadLine source) { - this.config = config; - this.raw = source; - } - - public void close() throws IOException { - raw.close(); - } - - public CharSequence2 readLine() throws IOException { - CharSequence2 result = null; - if (inserted != null) { - result = inserted.readLine(); - if (result == null) { - inserted.close(); - inserted = null; - } else { - return result; - } - } - result = raw.readLine(); - if (result != null && StartUtils.isArobaseStartDiagram(result) && config.size() > 0) { - this.inserted = new ReadLineList(config, result.getLocation()); - } - return result; - } - -} diff --git a/src/net/sourceforge/plantuml/preproc2/SubPreprocessor2.java b/src/net/sourceforge/plantuml/preproc2/SubPreprocessor2.java index ebe7e0201..80770d9c8 100644 --- a/src/net/sourceforge/plantuml/preproc2/SubPreprocessor2.java +++ b/src/net/sourceforge/plantuml/preproc2/SubPreprocessor2.java @@ -51,8 +51,8 @@ import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.command.regex.Pattern2; import net.sourceforge.plantuml.preproc.Defines; +import net.sourceforge.plantuml.preproc.DefinesGet; import net.sourceforge.plantuml.preproc.FileWithSuffix; -import net.sourceforge.plantuml.preproc.PreprocessorInclude; import net.sourceforge.plantuml.preproc.ReadLine; import net.sourceforge.plantuml.preproc.ReadLineReader; import net.sourceforge.plantuml.preproc.ReadLineSimple; @@ -67,13 +67,11 @@ public class SubPreprocessor2 implements ReadFilter { private static final Pattern2 startsub = MyPattern.cmpile("^[%s]*!startsub[%s]+(" + ID + ")"); private static final Pattern2 endsub = MyPattern.cmpile("^[%s]*!endsub[%s]*"); - private final Defines defines; private final DefinitionsContainer definitionsContainer; private final String charset; - public SubPreprocessor2(String charset, Defines defines, DefinitionsContainer definitionsContainer) { + public SubPreprocessor2(String charset, DefinitionsContainer definitionsContainer) { this.charset = charset; - this.defines = defines; this.definitionsContainer = definitionsContainer; } @@ -113,12 +111,12 @@ public class SubPreprocessor2 implements ReadFilter { if (idx != -1) { final String filename = name.substring(0, idx); final String blocname = name.substring(idx + 1); - final File f = FileSystem.getInstance().getFile(PreprocessorInclude.withEnvironmentVariable(filename)); + final File f = FileSystem.getInstance().getFile(PreprocessorInclude3.withEnvironmentVariable(filename)); if (f.exists() == false || f.isDirectory()) { Log.error("Cannot include " + FileWithSuffix.getAbsolutePath(f)); return s.withErrorPreprocessor("Cannot include " + FileWithSuffix.getFileName(f)); } - final SubPreprocessor2 data = new SubPreprocessor2(charset, defines, definitionsContainer); + final SubPreprocessor2 data = new SubPreprocessor2(charset, definitionsContainer); InnerReadLine tmp = (InnerReadLine) data.applyFilter(getReaderInclude(s, f)); while (tmp.readLine() != null) { // Read file diff --git a/src/net/sourceforge/plantuml/project2/Day.java b/src/net/sourceforge/plantuml/project2/Day.java deleted file mode 100644 index 1d617232d..000000000 --- a/src/net/sourceforge/plantuml/project2/Day.java +++ /dev/null @@ -1,171 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -import java.util.Calendar; -import java.util.GregorianCalendar; -import java.util.SimpleTimeZone; - -import net.sourceforge.plantuml.project.Month; -import net.sourceforge.plantuml.project.WeekDay; - -public class Day implements TimeElement { - - private final int numDay; - private final Month month; - private final int year; - private final WeekDay weekDay; - - private Day(int year, Month month, int numDay, WeekDay weekDay) { - this.year = year; - this.month = month; - this.numDay = numDay; - this.weekDay = weekDay; - } - - public static boolean isValidDesc(String desc) { - if (desc.matches("^\\d{4}/\\d{2}/\\d{2}$")) { - return true; - } - if (desc.matches("^\\d{2}-[A-Za-z]{3}-\\d{4}$")) { - return true; - } - return false; - } - - public Day(String desc) { - if (desc.matches("^\\d{4}/\\d{2}/\\d{2}$")) { - this.year = Integer.parseInt(desc.substring(0, 4)); - this.month = Month.fromNum(Integer.parseInt(desc.substring(5, 7))); - this.numDay = Integer.parseInt(desc.substring(8, 10)); - } else if (desc.matches("^\\d{2}-[A-Za-z]{3}-\\d{4}$")) { - this.year = Integer.parseInt(desc.substring(7, 11)); - this.month = Month.valueOf(desc.substring(3, 6)); - this.numDay = Integer.parseInt(desc.substring(0, 2)); - } else { - throw new IllegalArgumentException(desc); - } - final int wd = new GregorianCalendar(year, month.getNum() - 1, numDay).get(Calendar.DAY_OF_WEEK); - this.weekDay = WeekDay.values()[wd - 1]; - } - - public Day next() { - if (numDay < month.getNbDays(year)) { - return new Day(year, month, numDay + 1, weekDay.next()); - } - final Month next = month.next(); - if (next == null) { - return new Day(year + 1, Month.JAN, 1, weekDay.next()); - } - return new Day(year, next, 1, weekDay.next()); - } - - public Day previous() { - if (numDay > 1) { - return new Day(year, month, numDay - 1, weekDay.prev()); - } - final Month prev = month.prev(); - if (prev == null) { - return new Day(year - 1, Month.DEC, 31, weekDay.prev()); - } - return new Day(year, prev, prev.getNbDays(year), weekDay.prev()); - } - - @Override - public String toString() { - return "" + weekDay + " " + year + "-" + month + "-" + String.format("%02d", numDay); - } - - public final int getNumDay() { - return numDay; - } - - public final Month getMonth() { - return month; - } - - public final int getYear() { - return year; - } - - public int compareTo(TimeElement other2) { - final Day other = (Day) other2; - if (year > other.year) { - return 1; - } - if (year < other.year) { - return -1; - } - final int cmpMonth = month.compareTo(other.month); - if (cmpMonth != 0) { - return cmpMonth; - } - return numDay - other.numDay; - } - - @Override - public boolean equals(Object obj) { - final Day this2 = (Day) obj; - return this.numDay == this2.numDay && this.month == this2.month && this.year == this2.year; - } - - @Override - public int hashCode() { - return numDay * 420 + year + month.hashCode(); - } - - public final WeekDay getWeekDay() { - return weekDay; - } - - public long getTypicalDuration() { - return 1000L * 60 * 60 * 24; - } - - public long getStartUTC() { - final GregorianCalendar cal = new GregorianCalendar(new SimpleTimeZone(0, "GMT")); - cal.setTimeInMillis(0); - cal.set(GregorianCalendar.YEAR, year); - cal.set(GregorianCalendar.MONTH, month.getNumNormal()); - cal.set(GregorianCalendar.DAY_OF_MONTH, numDay); - return cal.getTimeInMillis(); - } - - public long getEndUTC() { - return next().getStartUTC(); - } - -} diff --git a/src/net/sourceforge/plantuml/project2/GanttDiagram2.java b/src/net/sourceforge/plantuml/project2/GanttDiagram2.java deleted file mode 100644 index fc0b47e50..000000000 --- a/src/net/sourceforge/plantuml/project2/GanttDiagram2.java +++ /dev/null @@ -1,112 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -import java.awt.Font; -import java.util.ArrayList; -import java.util.List; - -import net.sourceforge.plantuml.SpriteContainerEmpty; -import net.sourceforge.plantuml.cucadiagram.Display; -import net.sourceforge.plantuml.graphic.FontConfiguration; -import net.sourceforge.plantuml.graphic.HorizontalAlignment; -import net.sourceforge.plantuml.graphic.HtmlColorUtils; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.graphic.TextBlockUtils; -import net.sourceforge.plantuml.ugraphic.UFont; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class GanttDiagram2 { - - private final Project2 project; - private final double dayWith = 20; - - public GanttDiagram2(Project2 project) { - this.project = project; - } - - private final UFont font = UFont.serif(9); - private final FontConfiguration fontConfig = FontConfiguration.blackBlueTrue(font); - - public void draw(UGraphic ug, double x, double y) { - - final TextBlock timeHeader = project.getTimeHeader(dayWith); - final Row row = getMainRow(); - final TextBlock headers = row.header(); - - final double deltaX = headers.calculateDimension(ug.getStringBounder()).getWidth(); - final double deltaY = timeHeader.calculateDimension(ug.getStringBounder()).getHeight(); - - headers.drawU(ug.apply(new UTranslate(x, (y + deltaY)))); - final TextBlock tbRow = row.asTextBloc(project.getTimeConverter(dayWith)); - tbRow.drawU(ug.apply(new UTranslate((x + deltaX), (y + deltaY)))); - - timeHeader.drawU(ug.apply(new UTranslate((x + deltaX), y))); - } - - private Row getMainRow() { - final List tasks = project.getTasks(); - final List rows = new ArrayList(); - for (Task t : tasks) { - final String text = t.getCode(); - final TextBlock label = Display.create(text).create(fontConfig, HorizontalAlignment.LEFT, - new SpriteContainerEmpty()); - rows.add(new RowSimple((Day) t.getStart(), (Day) t.getEnd(), HtmlColorUtils.BLACK, TextBlockUtils - .withMargin(label, 3, 3))); - } - final Row row = RowUtils.merge(rows); - return row; - } - - public double getWidth(StringBounder stringBounder) { - final TextBlock timeHeader = project.getTimeHeader(dayWith); - final Row row = getMainRow(); - final TextBlock headers = row.header(); - return headers.calculateDimension(stringBounder).getWidth() - + timeHeader.calculateDimension(stringBounder).getWidth() + 1; - } - - public double getHeight(StringBounder stringBounder) { - final TextBlock timeHeader = project.getTimeHeader(dayWith); - final Row row = getMainRow(); - final TextBlock headers = row.header(); - return headers.calculateDimension(stringBounder).getHeight() - + timeHeader.calculateDimension(stringBounder).getHeight(); - } - -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/project2/Knowledge.java b/src/net/sourceforge/plantuml/project2/Knowledge.java deleted file mode 100644 index ac7dace23..000000000 --- a/src/net/sourceforge/plantuml/project2/Knowledge.java +++ /dev/null @@ -1,118 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -import java.util.HashMap; -import java.util.Map; - -import net.sourceforge.plantuml.StringUtils; - -public class Knowledge { - - private final TaskContainer taskContainer; - private final TimeLine timeline; - private final Map variables = new HashMap(); - - public Knowledge(TaskContainer taskContainer, TimeLine timeline) { - this.taskContainer = taskContainer; - this.timeline = timeline; - } - - public Value evaluate(String exp) { - exp = StringUtils.trin(exp); - int idx = exp.indexOf('$'); - if (idx != -1) { - return evaluate(exp.substring(0, idx), exp.substring(idx + 1)); - } - if (exp.matches("\\d+")) { - return new ValueInt(Integer.parseInt(exp)); - } - if (Day.isValidDesc(exp)) { - final Day day = new Day(exp); - return new ValueTime(day); - } - if (exp.startsWith("^")) { - exp = exp.substring(1); - } - if (variables.containsKey(exp)) { - return variables.get(exp); - } - idx = exp.indexOf("+"); - if (idx != -1) { - return plus(exp.substring(0, idx), exp.substring(idx + 1)); - } - throw new UnsupportedOperationException(exp); - - } - - private Value plus(String arg1, String arg2) { - final Value v1 = evaluate(arg1); - final Value v2 = evaluate(arg2); - if (v1 instanceof ValueInt && v2 instanceof ValueInt) { - return new ValueInt(((ValueInt) v1).getValue() + ((ValueInt) v2).getValue()); - } - if (v1 instanceof ValueTime && v2 instanceof ValueInt) { - final int nb = ((ValueInt) v2).getValue(); - TimeElement t = ((ValueTime) v1).getValue(); - if (nb > 0) { - for (int i = 0; i < nb; i++) { - t = timeline.next(t); - } - } - if (nb < 0) { - for (int i = 0; i < -nb; i++) { - t = timeline.previous(t); - } - } - return new ValueTime(t); - } - throw new UnsupportedOperationException(); - } - - private Value evaluate(String task, String attribute) { - final Task t = taskContainer.getTask(task); - final TaskAttribute att = TaskAttribute.fromString(attribute); - if (att == TaskAttribute.COMPLETED) { - return new ValueTime(t.getCompleted()); - } - throw new UnsupportedOperationException(); - } - - public void set(String var, Value exp) { - variables.put(var, exp); - } - -} diff --git a/src/net/sourceforge/plantuml/project2/PSystemProject2.java b/src/net/sourceforge/plantuml/project2/PSystemProject2.java deleted file mode 100644 index 926e1d1f0..000000000 --- a/src/net/sourceforge/plantuml/project2/PSystemProject2.java +++ /dev/null @@ -1,128 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.OutputStream; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.EmptyImageBuilder; -import net.sourceforge.plantuml.FileFormat; -import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.api.ImageDataSimple; -import net.sourceforge.plantuml.core.DiagramDescription; -import net.sourceforge.plantuml.core.ImageData; -import net.sourceforge.plantuml.eps.EpsStrategy; -import net.sourceforge.plantuml.png.PngIO; -import net.sourceforge.plantuml.ugraphic.ColorMapper; -import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; -import net.sourceforge.plantuml.ugraphic.eps.UGraphicEps; -import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d; -import net.sourceforge.plantuml.ugraphic.svg.UGraphicSvg; - -public class PSystemProject2 extends AbstractPSystem { - - private final Project2 project = new Project2(); - private final Color background = Color.WHITE; - private final ColorMapper colorMapper = new ColorMapperIdentity(); - - public int getNbImages() { - return 1; - } - - public DiagramDescription getDescription() { - return new DiagramDescription("(Project)"); - } - - @Override - final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormatOption, long seed) - throws IOException { - final GanttDiagram2 diagram = new GanttDiagram2(project); - final FileFormat fileFormat = fileFormatOption.getFileFormat(); - if (fileFormat == FileFormat.PNG) { - final BufferedImage im = createImage(diagram); - PngIO.write(im, os, fileFormatOption.isWithMetadata() ? getMetadata() : null, 96); - } else if (fileFormat == FileFormat.SVG) { - final UGraphicSvg svg = new UGraphicSvg(true, new Dimension2DDouble(0, 0), colorMapper, - StringUtils.getAsHtml(background), false, 1.0, fileFormatOption.getSvgLinkTarget(), - fileFormatOption.getHoverColor(), seed()); - diagram.draw(svg, 0, 0); - svg.createXml(os, fileFormatOption.isWithMetadata() ? getMetadata() : null); - } else if (fileFormat == FileFormat.EPS) { - final UGraphicEps eps = new UGraphicEps(colorMapper, EpsStrategy.getDefault2()); - diagram.draw(eps, 0, 0); - os.write(eps.getEPSCode().getBytes()); - } else if (fileFormat == FileFormat.EPS_TEXT) { - final UGraphicEps eps = new UGraphicEps(colorMapper, EpsStrategy.WITH_MACRO_AND_TEXT); - diagram.draw(eps, 0, 0); - os.write(eps.getEPSCode().getBytes()); - } else { - throw new UnsupportedOperationException(); - } - return ImageDataSimple.ok(); - } - - private BufferedImage createImage(GanttDiagram2 diagram) { - EmptyImageBuilder builder = new EmptyImageBuilder(10, 10, background); - Graphics2D g2d = builder.getGraphics2D(); - UGraphicG2d ug = new UGraphicG2d(colorMapper, g2d, 1.0); - - final double height = diagram.getHeight(ug.getStringBounder()); - final double width = diagram.getWidth(ug.getStringBounder()); - - g2d.dispose(); - - builder = new EmptyImageBuilder(width, height, background); - final BufferedImage im = builder.getBufferedImage(); - g2d = builder.getGraphics2D(); - - ug = new UGraphicG2d(colorMapper, g2d, 1.0); - ug.setBufferedImage(im); - diagram.draw(ug, 0, 0); - g2d.dispose(); - return im; - } - - public final Project2 getProject() { - return project; - } - -} diff --git a/src/net/sourceforge/plantuml/project2/PSystemProjectFactory2.java b/src/net/sourceforge/plantuml/project2/PSystemProjectFactory2.java deleted file mode 100644 index 805033242..000000000 --- a/src/net/sourceforge/plantuml/project2/PSystemProjectFactory2.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -import java.util.ArrayList; -import java.util.List; - -import net.sourceforge.plantuml.command.Command; -import net.sourceforge.plantuml.command.CommandComment; -import net.sourceforge.plantuml.command.CommandMultilinesComment; -import net.sourceforge.plantuml.command.CommandNope; -import net.sourceforge.plantuml.command.UmlDiagramFactory; -import net.sourceforge.plantuml.core.DiagramType; -import net.sourceforge.plantuml.project2.command.CommandAffectation; -import net.sourceforge.plantuml.project2.command.CommandCloseWeekDay; - -public class PSystemProjectFactory2 extends UmlDiagramFactory { - - public PSystemProjectFactory2() { - super(DiagramType.PROJECT); - } - - @Override - protected List createCommands() { - final List cmds = new ArrayList(); - cmds.add(new CommandNope()); -// cmds.add(new CommandComment()); -// cmds.add(new CommandMultilinesComment()); - cmds.add(new CommandAffectation()); - cmds.add(new CommandCloseWeekDay()); - return cmds; - } - - @Override - public PSystemProject2 createEmptyDiagram() { - return new PSystemProject2(); - } - -} diff --git a/src/net/sourceforge/plantuml/project2/Project2.java b/src/net/sourceforge/plantuml/project2/Project2.java deleted file mode 100644 index ed5a2fe62..000000000 --- a/src/net/sourceforge/plantuml/project2/Project2.java +++ /dev/null @@ -1,166 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.sourceforge.plantuml.graphic.HorizontalAlignment; -import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.graphic.TextBlockUtils; - -public class Project2 implements TaskContainer { - - private final TimeLine timeline; - private final Knowledge knowledge; - private final List tasks = new ArrayList(); - - public Project2() { - this.timeline = new TimeLineDay(); - this.knowledge = new Knowledge(this, timeline); - } - - public TimeConverter getTimeConverter(double dayWith) { - return new TimeConverterDay(timeline, getStart(), dayWith); - } - - public Value getExpression(String exp) { - return knowledge.evaluate(exp); - } - - public boolean affectation(String var, Value exp) { - final int idx = var.indexOf('$'); - if (idx != -1) { - return affectationTask(var.substring(0, idx), var.substring(idx + 1), exp); - } - if (var.startsWith("^")) { - return affectationJalon(var.substring(1), exp); - } - knowledge.set(var, exp); - return true; - } - - private boolean affectationJalon(String taskCode, Value exp) { - final TaskImpl result = new TaskImpl(timeline, taskCode); - result.setStart(((ValueTime) exp).getValue()); - result.setDuration(0); - tasks.add(result); - knowledge.set(taskCode, exp); - return true; - } - - private boolean affectationTask(String taskCode, String attribute, Value exp) { - final TaskImpl t = getOrCreateTask(taskCode); - final TaskAttribute att = TaskAttribute.fromString(attribute); - if (att == TaskAttribute.START) { - t.setStart(((ValueTime) exp).getValue()); - return true; - } - if (att == TaskAttribute.DURATION) { - t.setDuration(((ValueInt) exp).getValue()); - return true; - } - if (att == TaskAttribute.LOAD) { - t.setLoad(((ValueInt) exp).getValue()); - return true; - } - throw new UnsupportedOperationException(); - } - - private TaskImpl getOrCreateTask(String taskCode) { - TaskImpl result = (TaskImpl) getTask(taskCode); - if (result != null) { - return result; - } - result = new TaskImpl(timeline, taskCode); - tasks.add(result); - return result; - } - - public final List getTasks() { - final List result = new ArrayList(tasks); - return Collections.unmodifiableList(result); - } - - public Task getTask(String code) { - for (TaskImpl t : tasks) { - if (t.getCode().equals(code)) { - return t; - } - } - Task result = null; - for (Task t : tasks) { - if (t.getCode().startsWith(code) == false) { - continue; - } - if (result == null) { - result = t; - } else { - result = new TaskMerge(result.getCode(), result.getName(), result, t); - } - - } - return result; - } - - public TextBlock getTimeHeader(double dayWith) { - final TimeHeaderDay day = new TimeHeaderDay(getStart(), getEnd(), timeline, dayWith); - final TimeHeaderMonth month = new TimeHeaderMonth(getStart(), getEnd(), timeline, dayWith); - return TextBlockUtils.mergeTB(month, day, HorizontalAlignment.CENTER); - } - - private Day getStart() { - Day result = null; - for (Task t : tasks) { - if (result == null || result.compareTo(t.getStart()) > 0) { - result = (Day) t.getStart(); - } - } - return result; - } - - private Day getEnd() { - Day result = null; - for (Task t : tasks) { - if (result == null || result.compareTo(t.getEnd()) < 0) { - result = (Day) t.getEnd(); - } - } - return result; - } - -} diff --git a/src/net/sourceforge/plantuml/project2/Ressource.java b/src/net/sourceforge/plantuml/project2/Ressource.java deleted file mode 100644 index 5ea2a80ce..000000000 --- a/src/net/sourceforge/plantuml/project2/Ressource.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -public class Ressource { - - private final String code; - - public Ressource(String code) { - this.code = code; - } - -} diff --git a/src/net/sourceforge/plantuml/project2/Row.java b/src/net/sourceforge/plantuml/project2/Row.java deleted file mode 100644 index 22b487133..000000000 --- a/src/net/sourceforge/plantuml/project2/Row.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -import net.sourceforge.plantuml.graphic.TextBlock; - -public interface Row { - - public TextBlock asTextBloc(TimeConverter timeConverter); - - public double getMinXwithoutHeader(TimeConverter timeConverter); - - public double getMaxXwithoutHeader(TimeConverter timeConverter); - - public TextBlock header(); - - public double getHeight(); - -} diff --git a/src/net/sourceforge/plantuml/project2/RowMerge.java b/src/net/sourceforge/plantuml/project2/RowMerge.java deleted file mode 100644 index 3b1094853..000000000 --- a/src/net/sourceforge/plantuml/project2/RowMerge.java +++ /dev/null @@ -1,102 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.graphic.AbstractTextBlock; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -class RowMerge implements Row { - - private final Row r1; - private final Row r2; - - public RowMerge(Row r1, Row r2) { - this.r1 = r1; - this.r2 = r2; - } - - public TextBlock asTextBloc(final TimeConverter timeConverter) { - return new AbstractTextBlock() { - - public void drawU(UGraphic ug) { - r1.asTextBloc(timeConverter).drawU(ug); - r2.asTextBloc(timeConverter).drawU(ug.apply(new UTranslate(0, r1.getHeight()))); - } - - public Dimension2D calculateDimension(StringBounder stringBounder) { - final double width = getMaxXwithoutHeader(timeConverter) - getMinXwithoutHeader(timeConverter); - final double height = getHeight(); - return new Dimension2DDouble(width, height); - } - }; - } - - public double getMinXwithoutHeader(TimeConverter timeConverter) { - return Math.min(r1.getMinXwithoutHeader(timeConverter), r2.getMinXwithoutHeader(timeConverter)); - } - - public double getMaxXwithoutHeader(TimeConverter timeConverter) { - return Math.max(r1.getMaxXwithoutHeader(timeConverter), r2.getMaxXwithoutHeader(timeConverter)); - } - - public double getHeight() { - return r1.getHeight() + r2.getHeight(); - } - - public TextBlock header() { - return new AbstractTextBlock() { - - public void drawU(UGraphic ug) { - r1.header().drawU(ug); - r2.header().drawU(ug.apply(new UTranslate(0, r1.getHeight()))); - } - - public Dimension2D calculateDimension(StringBounder stringBounder) { - final double width = Math.max(r1.header().calculateDimension(stringBounder).getWidth(), r2.header() - .calculateDimension(stringBounder).getWidth()); - final double height = getHeight(); - return new Dimension2DDouble(width, height); - } - }; - } - -} diff --git a/src/net/sourceforge/plantuml/project2/RowOverwrite.java b/src/net/sourceforge/plantuml/project2/RowOverwrite.java deleted file mode 100644 index 0d7e5188e..000000000 --- a/src/net/sourceforge/plantuml/project2/RowOverwrite.java +++ /dev/null @@ -1,92 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.graphic.AbstractTextBlock; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -class RowOverwrite implements Row { - - private final Row r1; - private final Row r2; - - public RowOverwrite(Row r1, Row r2) { - this.r1 = r1; - this.r2 = r2; - } - - public TextBlock asTextBloc(final TimeConverter timeConverter) { - return new AbstractTextBlock() { - - public void drawU(UGraphic ug) { - final double minX = getMinXwithoutHeader(timeConverter); - final double minXr1 = r1.getMinXwithoutHeader(timeConverter); - final double minXr2 = r2.getMinXwithoutHeader(timeConverter); - r1.asTextBloc(timeConverter).drawU(ug.apply(new UTranslate((minXr1 - minX), 0))); - r2.asTextBloc(timeConverter).drawU(ug.apply(new UTranslate((minXr2 - minX), 0))); - } - - public Dimension2D calculateDimension(StringBounder stringBounder) { - final double width = getMaxXwithoutHeader(timeConverter) - getMinXwithoutHeader(timeConverter); - final double height = getHeight(); - return new Dimension2DDouble(width, height); - } - }; - } - - public double getMinXwithoutHeader(TimeConverter timeConverter) { - return Math.min(r1.getMinXwithoutHeader(timeConverter), r2.getMinXwithoutHeader(timeConverter)); - } - - public double getMaxXwithoutHeader(TimeConverter timeConverter) { - return Math.max(r1.getMaxXwithoutHeader(timeConverter), r2.getMaxXwithoutHeader(timeConverter)); - } - - public double getHeight() { - return Math.max(r1.getHeight(), r2.getHeight()); - } - - public TextBlock header() { - return r1.header(); - } - -} diff --git a/src/net/sourceforge/plantuml/project2/RowSimple.java b/src/net/sourceforge/plantuml/project2/RowSimple.java deleted file mode 100644 index a1471a2f2..000000000 --- a/src/net/sourceforge/plantuml/project2/RowSimple.java +++ /dev/null @@ -1,114 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.graphic.AbstractTextBlock; -import net.sourceforge.plantuml.graphic.HtmlColor; -import net.sourceforge.plantuml.graphic.HtmlColorUtils; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.graphic.TextBlockUtils; -import net.sourceforge.plantuml.ugraphic.UChangeBackColor; -import net.sourceforge.plantuml.ugraphic.UChangeColor; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.URectangle; -import net.sourceforge.plantuml.ugraphic.UShape; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class RowSimple implements Row { - - private static final int HEIGHT = 12; - private final Day first; - private final Day last; - private final HtmlColor backcolor; - private final TextBlock header; - - public RowSimple(Day first, Day last) { - this(first, last, HtmlColorUtils.BLACK); - } - - public RowSimple(Day first, Day last, HtmlColor backcolor) { - this(first, last, backcolor, TextBlockUtils.empty(0, HEIGHT)); - } - - public RowSimple(Day first, Day last, HtmlColor backcolor, TextBlock header) { - this.first = first; - this.last = last; - this.backcolor = backcolor; - if (last.compareTo(first) < 0) { - throw new IllegalArgumentException(); - } - this.header = header; - } - - public TextBlock asTextBloc(final TimeConverter timeConverter) { - return new AbstractTextBlock() { - - public void drawU(UGraphic ug) { - final double x1 = getMinXwithoutHeader(timeConverter) + 1; - final double x2 = getMaxXwithoutHeader(timeConverter) - 1; - final double height = getHeight() - 4; - final UShape rect = new URectangle(x2 - x1, height, 4, 4); - ug.apply(new UChangeColor(HtmlColorUtils.RED)).apply(new UChangeBackColor(backcolor)).apply(new UTranslate(x1, 2)).draw(rect); - } - - public Dimension2D calculateDimension(StringBounder stringBounder) { - final double width = getMaxXwithoutHeader(timeConverter) - getMinXwithoutHeader(timeConverter); - final double height = getHeight(); - return new Dimension2DDouble(width, height); - } - }; - } - - public double getMinXwithoutHeader(TimeConverter timeConverter) { - return timeConverter.getStartPosition(first); - } - - public double getMaxXwithoutHeader(TimeConverter timeConverter) { - return timeConverter.getEndPosition(last); - } - - public double getHeight() { - return HEIGHT; - } - - public TextBlock header() { - return header; - } -} diff --git a/src/net/sourceforge/plantuml/project2/RowUtils.java b/src/net/sourceforge/plantuml/project2/RowUtils.java deleted file mode 100644 index b591c1da0..000000000 --- a/src/net/sourceforge/plantuml/project2/RowUtils.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -import java.util.List; - -public abstract class RowUtils { - - public static Row overwrite(Row r1, Row r2) { - return new RowOverwrite(r1, r2); - } - - public static Row merge(Row r1, Row r2) { - return new RowMerge(r1, r2); - } - - public static Row merge(List rows) { - Row result = rows.get(0); - for (int i = 1; i < rows.size(); i++) { - result = merge(result, rows.get(i)); - } - return result; - - } - -} diff --git a/src/net/sourceforge/plantuml/project2/Task.java b/src/net/sourceforge/plantuml/project2/Task.java deleted file mode 100644 index 8a9b8796c..000000000 --- a/src/net/sourceforge/plantuml/project2/Task.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -public interface Task { - - public String getCode(); - - public String getName(); - - public long getLoad(); - - public TimeElement getStart(); - - public TimeElement getEnd(); - - public TimeElement getCompleted(); - -} diff --git a/src/net/sourceforge/plantuml/project2/TaskAttribute.java b/src/net/sourceforge/plantuml/project2/TaskAttribute.java deleted file mode 100644 index f9ab05b99..000000000 --- a/src/net/sourceforge/plantuml/project2/TaskAttribute.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -public enum TaskAttribute { - - START, END, COMPLETED, DURATION, LOAD; - - static public TaskAttribute fromString(String n) { - if (n.equalsIgnoreCase("begin")) { - return START; - } - if (n.equalsIgnoreCase("start")) { - return START; - } - if (n.equalsIgnoreCase("work")) { - return LOAD; - } - if (n.equalsIgnoreCase("load")) { - return LOAD; - } - if (n.equalsIgnoreCase("duration")) { - return DURATION; - } - if (n.equalsIgnoreCase("completed")) { - return COMPLETED; - } - return null; - } - -} diff --git a/src/net/sourceforge/plantuml/project2/TaskContainer.java b/src/net/sourceforge/plantuml/project2/TaskContainer.java deleted file mode 100644 index d02ff1ee5..000000000 --- a/src/net/sourceforge/plantuml/project2/TaskContainer.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -public interface TaskContainer { - - public Task getTask(String code); - -} diff --git a/src/net/sourceforge/plantuml/project2/TaskImpl.java b/src/net/sourceforge/plantuml/project2/TaskImpl.java deleted file mode 100644 index ebbebc6b7..000000000 --- a/src/net/sourceforge/plantuml/project2/TaskImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -public class TaskImpl implements Task { - - private final String code; - private TimeElement start; - private TimeElement end; - private int duration; - private final TimeLine timeLine; - - public TaskImpl(TimeLine timeLine, String code) { - this.code = code; - this.timeLine = timeLine; - } - - public String getCode() { - return code; - } - - public String getName() { - return code; - } - - public long getLoad() { - throw new UnsupportedOperationException(); - } - - public TimeElement getStart() { - return start; - } - - public TimeElement getEnd() { - TimeElement result = start; - for (int i = 1; i < duration; i++) { - result = timeLine.next(result); - } - return result; - } - - public TimeElement getCompleted() { - return timeLine.next(getEnd()); - } - - public void setStart(TimeElement exp) { - this.start = exp; - } - - public void setDuration(int value) { - this.duration = value; - } - - public void setLoad(int value) { - } - -} diff --git a/src/net/sourceforge/plantuml/project2/TaskMerge.java b/src/net/sourceforge/plantuml/project2/TaskMerge.java deleted file mode 100644 index 5b55a439b..000000000 --- a/src/net/sourceforge/plantuml/project2/TaskMerge.java +++ /dev/null @@ -1,76 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -class TaskMerge implements Task { - - private final String code; - private final String name; - private final Task task1; - private final Task task2; - - TaskMerge(String code, String name, Task task1, Task task2) { - this.code = code; - this.name = name; - this.task1 = task1; - this.task2 = task2; - } - - public String getCode() { - return code; - } - - public String getName() { - return name; - } - - public long getLoad() { - throw new UnsupportedOperationException(); - } - - public TimeElement getStart() { - return TimeUtils.min(task1.getStart(), task2.getStart()); - } - - public TimeElement getEnd() { - return TimeUtils.max(task1.getEnd(), task2.getEnd()); - } - - public TimeElement getCompleted() { - return TimeUtils.max(task1.getCompleted(), task2.getCompleted()); - } - -} diff --git a/src/net/sourceforge/plantuml/project2/TimeConverter.java b/src/net/sourceforge/plantuml/project2/TimeConverter.java deleted file mode 100644 index 0f374262a..000000000 --- a/src/net/sourceforge/plantuml/project2/TimeConverter.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -public interface TimeConverter { - - public TimeElement getCorrespondingElement(long position); - - public double getStartPosition(TimeElement timeElement); - - public double getEndPosition(TimeElement timeElement); - -} diff --git a/src/net/sourceforge/plantuml/project2/TimeConverterDay.java b/src/net/sourceforge/plantuml/project2/TimeConverterDay.java deleted file mode 100644 index 21c362f4e..000000000 --- a/src/net/sourceforge/plantuml/project2/TimeConverterDay.java +++ /dev/null @@ -1,112 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -import java.util.HashMap; -import java.util.Map; - -public class TimeConverterDay implements TimeConverter { - - private Day biggest; - private Day smallest; - private final double dayWith; - private final Map map1 = new HashMap(); - private final Map map2 = new HashMap(); - private final TimeLine timeLine; - - public TimeConverterDay(TimeLine timeLine, Day start, double dayWith) { - this.timeLine = timeLine; - this.dayWith = dayWith; - this.biggest = start; - this.smallest = start; - putDay(start, 0); - } - -// private boolean isClosed(Day d) { -// WeekDay wd = d.getWeekDay(); -// if (wd == WeekDay.SAT || wd == WeekDay.SUN) { -// return true; -// } -// return false; -// } - - private int getPosition(Day d) { - Integer result = map1.get(d); - if (result != null) { - return result.intValue(); - } - while (d.compareTo(biggest) > 0) { - int n = getPosition(biggest); - biggest = biggest.next(); - if (timeLine.isClosed(biggest) == false) { - n++; - } - putDay(biggest, n); - } - while (d.compareTo(smallest) < 0) { - int n = getPosition(smallest); - smallest = smallest.previous(); - if (timeLine.isClosed(smallest) == false) { - n--; - } - putDay(smallest, n); - } - result = map1.get(d); - if (result != null) { - return result.intValue(); - } - throw new UnsupportedOperationException(); - } - - private void putDay(Day d, int n) { - map1.put(d, n); - map2.put(n, d); - - } - - public Day getCorrespondingElement(long position) { - throw new UnsupportedOperationException(); - } - - public double getStartPosition(TimeElement timeElement) { - return getPosition((Day) timeElement) * dayWith; - } - - public double getEndPosition(TimeElement timeElement) { - return (getPosition((Day) timeElement) + 1) * dayWith; - } - -} diff --git a/src/net/sourceforge/plantuml/project2/TimeElement.java b/src/net/sourceforge/plantuml/project2/TimeElement.java deleted file mode 100644 index e8f6bcae8..000000000 --- a/src/net/sourceforge/plantuml/project2/TimeElement.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -public interface TimeElement extends Comparable { - - public long getTypicalDuration(); - - public long getStartUTC(); - - public long getEndUTC(); - - public TimeElement next(); - - public TimeElement previous(); - -} diff --git a/src/net/sourceforge/plantuml/project2/TimeHeaderDay.java b/src/net/sourceforge/plantuml/project2/TimeHeaderDay.java deleted file mode 100644 index 7e08908c6..000000000 --- a/src/net/sourceforge/plantuml/project2/TimeHeaderDay.java +++ /dev/null @@ -1,102 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -import java.awt.Font; -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.SpriteContainerEmpty; -import net.sourceforge.plantuml.cucadiagram.Display; -import net.sourceforge.plantuml.graphic.AbstractTextBlock; -import net.sourceforge.plantuml.graphic.FontConfiguration; -import net.sourceforge.plantuml.graphic.HorizontalAlignment; -import net.sourceforge.plantuml.graphic.HtmlColorUtils; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.ugraphic.UChangeBackColor; -import net.sourceforge.plantuml.ugraphic.UChangeColor; -import net.sourceforge.plantuml.ugraphic.UFont; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.URectangle; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class TimeHeaderDay extends AbstractTextBlock implements TextBlock { - - private final Day start; - private final Day end; - private final TimeLine timeline; - private final double dayWidth; - - private final UFont font = UFont.serif(9); - private final FontConfiguration fontConfig = FontConfiguration.blackBlueTrue(font); - - public TimeHeaderDay(Day start, Day end, TimeLine timeline, double dayWidth) { - this.start = start; - this.end = end; - this.timeline = timeline; - this.dayWidth = dayWidth; - } - - public void drawU(UGraphic ug) { - int n = 0; - for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) { - final String text = "" + d.getNumDay(); - final TextBlock b = Display.create(text).create(fontConfig, HorizontalAlignment.LEFT, - new SpriteContainerEmpty()); - final Dimension2D dimText = b.calculateDimension(ug.getStringBounder()); - final double diffX = dayWidth - dimText.getWidth(); - final double diffY = getHeight() - dimText.getHeight(); - ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK)); - ug = ug.apply(new UChangeBackColor(HtmlColorUtils.WHITE)); - ug.apply(new UTranslate(n * dayWidth, 0)).draw(new URectangle(dayWidth, getHeight())); - b.drawU(ug.apply(new UTranslate((n * dayWidth + diffX / 2), (diffY / 2)))); - n++; - } - } - - private double getHeight() { - return 20; - } - - public Dimension2D calculateDimension(StringBounder stringBounder) { - int n = 0; - for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) { - n++; - } - return new Dimension2DDouble(n * dayWidth, getHeight()); - } -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/project2/TimeHeaderMonth.java b/src/net/sourceforge/plantuml/project2/TimeHeaderMonth.java deleted file mode 100644 index 79a98aa84..000000000 --- a/src/net/sourceforge/plantuml/project2/TimeHeaderMonth.java +++ /dev/null @@ -1,119 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -import java.awt.Font; -import java.awt.geom.Dimension2D; - -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.SpriteContainerEmpty; -import net.sourceforge.plantuml.cucadiagram.Display; -import net.sourceforge.plantuml.graphic.AbstractTextBlock; -import net.sourceforge.plantuml.graphic.FontConfiguration; -import net.sourceforge.plantuml.graphic.HorizontalAlignment; -import net.sourceforge.plantuml.graphic.HtmlColorUtils; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.ugraphic.UChangeBackColor; -import net.sourceforge.plantuml.ugraphic.UChangeColor; -import net.sourceforge.plantuml.ugraphic.UFont; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.URectangle; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class TimeHeaderMonth extends AbstractTextBlock implements TextBlock { - - private final Day start; - private final Day end; - private final TimeLine timeline; - private final double dayWidth; - - private final UFont font = UFont.serif(9); - private final FontConfiguration fontConfig = FontConfiguration.blackBlueTrue(font); - - public TimeHeaderMonth(Day start, Day end, TimeLine timeline, double dayWidth) { - this.start = start; - this.end = end; - this.timeline = timeline; - this.dayWidth = dayWidth; - } - - public void drawU(UGraphic ug) { - int n = 0; - String last = null; - - double pendingX = -1; - for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) { - final String text = "" + d.getMonth().name(); - if (pendingX == -1) { - pendingX = n * dayWidth; - last = text; - } - ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK)); - ug = ug.apply(new UChangeBackColor(HtmlColorUtils.WHITE)); - if (text.equals(last) == false) { - manage(ug, 0, 0, n, last, pendingX); - pendingX = n * dayWidth; - } - last = text; - n++; - } - manage(ug, 0, 0, n, last, pendingX); - } - - private void manage(UGraphic ug, double x, double y, int n, String last, double pendingX) { - final double width = n * dayWidth - pendingX; - ug.apply(new UTranslate(x + pendingX, y)).draw(new URectangle(width, getHeight())); - final TextBlock b = Display.create(last).create(fontConfig, HorizontalAlignment.LEFT, - new SpriteContainerEmpty()); - final Dimension2D dimText = b.calculateDimension(ug.getStringBounder()); - final double diffX = width - dimText.getWidth(); - final double diffY = getHeight() - dimText.getHeight(); - b.drawU(ug.apply(new UTranslate((x + pendingX + diffX / 2), (y + diffY / 2)))); - } - - private double getHeight() { - return 20; - } - - public Dimension2D calculateDimension(StringBounder stringBounder) { - int n = 0; - for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) { - n++; - } - return new Dimension2DDouble(n * dayWidth, getHeight()); - } -} \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/project2/TimeLine.java b/src/net/sourceforge/plantuml/project2/TimeLine.java deleted file mode 100644 index f94ee18fc..000000000 --- a/src/net/sourceforge/plantuml/project2/TimeLine.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -public interface TimeLine { - - public TimeElement next(TimeElement timeElement); - - public TimeElement previous(TimeElement timeElement); - - public TimeResolution getTimeResolution(); - - public boolean isClosed(TimeElement timeElement); - -} diff --git a/src/net/sourceforge/plantuml/project2/TimeLineDay.java b/src/net/sourceforge/plantuml/project2/TimeLineDay.java deleted file mode 100644 index e52ed348d..000000000 --- a/src/net/sourceforge/plantuml/project2/TimeLineDay.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -import net.sourceforge.plantuml.project.WeekDay; - -public class TimeLineDay implements TimeLine { - - public TimeElement next(TimeElement timeElement) { - do { - timeElement = timeElement.next(); - if (isClosed(timeElement) == false) { - return timeElement; - } - } while (true); - } - - public TimeElement previous(TimeElement timeElement) { - do { - timeElement = timeElement.previous(); - if (isClosed(timeElement) == false) { - return timeElement; - } - } while (true); - } - - public TimeResolution getTimeResolution() { - return TimeResolution.DAY; - } - - public boolean isClosed(TimeElement timeElement) { - final WeekDay wd = ((Day) timeElement).getWeekDay(); - if (wd == WeekDay.SAT || wd == WeekDay.SUN) { - return true; - } - return false; - } - -} diff --git a/src/net/sourceforge/plantuml/project2/TimeResolution.java b/src/net/sourceforge/plantuml/project2/TimeResolution.java deleted file mode 100644 index bc73807d6..000000000 --- a/src/net/sourceforge/plantuml/project2/TimeResolution.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -public enum TimeResolution { - DAY, WEEK, MONTH, YEAR -} diff --git a/src/net/sourceforge/plantuml/project2/TimeUtils.java b/src/net/sourceforge/plantuml/project2/TimeUtils.java deleted file mode 100644 index bd4114386..000000000 --- a/src/net/sourceforge/plantuml/project2/TimeUtils.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -public class TimeUtils { - - static public TimeElement max(TimeElement t1, TimeElement t2) { - if (t1 == null) { - throw new IllegalArgumentException(); - } - if (t2 == null) { - throw new IllegalArgumentException(); - } - if (t1.compareTo(t2) > 0) { - return t1; - } - return t2; - } - - static public TimeElement min(TimeElement t1, TimeElement t2) { - if (t1 == null) { - throw new IllegalArgumentException(); - } - if (t2 == null) { - throw new IllegalArgumentException(); - } - if (t1.compareTo(t2) < 0) { - return t1; - } - return t2; - } - -} diff --git a/src/net/sourceforge/plantuml/project2/Value.java b/src/net/sourceforge/plantuml/project2/Value.java deleted file mode 100644 index e841355c3..000000000 --- a/src/net/sourceforge/plantuml/project2/Value.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -public interface Value { -} diff --git a/src/net/sourceforge/plantuml/project2/ValueInt.java b/src/net/sourceforge/plantuml/project2/ValueInt.java deleted file mode 100644 index 30ac5d235..000000000 --- a/src/net/sourceforge/plantuml/project2/ValueInt.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -public class ValueInt implements Value { - - private final int value; - - public ValueInt(int value) { - this.value = value; - } - - public final int getValue() { - return value; - } - - public Value plus(Value other) { - final ValueInt other2 = (ValueInt) other; - return new ValueInt(value + other2.value); - } - -} diff --git a/src/net/sourceforge/plantuml/project2/ValueTime.java b/src/net/sourceforge/plantuml/project2/ValueTime.java deleted file mode 100644 index f8fd34bd3..000000000 --- a/src/net/sourceforge/plantuml/project2/ValueTime.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2; - -public class ValueTime implements Value { - - private final TimeElement value; - - public ValueTime(TimeElement value) { - this.value = value; - } - - public final TimeElement getValue() { - return value; - } -} diff --git a/src/net/sourceforge/plantuml/project2/command/CommandAffectation.java b/src/net/sourceforge/plantuml/project2/command/CommandAffectation.java deleted file mode 100644 index 695b560d6..000000000 --- a/src/net/sourceforge/plantuml/project2/command/CommandAffectation.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2.command; - -import java.util.List; - -import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.command.CommandExecutionResult; -import net.sourceforge.plantuml.command.SingleLineCommand; -import net.sourceforge.plantuml.project2.PSystemProject2; -import net.sourceforge.plantuml.project2.Value; - -public class CommandAffectation extends SingleLineCommand { - - public CommandAffectation() { - super("(?i)^[%s]*([~\\^]?[\\w$/]+)[%s]*:=[%s]*(.+)$"); - } - - @Override - protected CommandExecutionResult executeArg(PSystemProject2 diagram, List arg) { - final Value exp = diagram.getProject().getExpression(StringUtils.trin(arg.get(1))); - final boolean ok = diagram.getProject().affectation(StringUtils.trin(arg.get(0)), exp); - if (ok) { - return CommandExecutionResult.ok(); - } - return CommandExecutionResult.error("Cannot execute CommandAffectation"); - } -} diff --git a/src/net/sourceforge/plantuml/project2/command/CommandCloseWeekDay.java b/src/net/sourceforge/plantuml/project2/command/CommandCloseWeekDay.java deleted file mode 100644 index 3731eeb1b..000000000 --- a/src/net/sourceforge/plantuml/project2/command/CommandCloseWeekDay.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2017, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.project2.command; - -import java.util.List; - -import net.sourceforge.plantuml.command.CommandExecutionResult; -import net.sourceforge.plantuml.command.SingleLineCommand; -import net.sourceforge.plantuml.project2.PSystemProject2; - -public class CommandCloseWeekDay extends SingleLineCommand { - - public CommandCloseWeekDay() { - super("(?i)^[%s]*close[%s]+(\\w{3,}day)[%s]*$"); - } - - @Override - protected CommandExecutionResult executeArg(PSystemProject2 diagram, List arg) { - // final WeekDay weekDay = WeekDay.valueOf(arg.get(0).substring(0, 3).goUpperCase()); -// getSystem().getProject().closeWeekDay(weekDay); - return CommandExecutionResult.ok(); - } -} diff --git a/src/net/sourceforge/plantuml/project3/ComplementBeforeOrAfterOrAtTaskStartOrEnd.java b/src/net/sourceforge/plantuml/project3/ComplementBeforeOrAfterOrAtTaskStartOrEnd.java index 7e645ef58..5a76af8fa 100644 --- a/src/net/sourceforge/plantuml/project3/ComplementBeforeOrAfterOrAtTaskStartOrEnd.java +++ b/src/net/sourceforge/plantuml/project3/ComplementBeforeOrAfterOrAtTaskStartOrEnd.java @@ -49,7 +49,7 @@ public class ComplementBeforeOrAfterOrAtTaskStartOrEnd implements ComplementPatt public Failable getComplement(GanttDiagram system, RegexResult arg, String suffix) { final String code = arg.get("COMPLEMENT" + suffix, 2); final String position = arg.get("COMPLEMENT" + suffix, 3); - final Task task = system.getExistingTask(code); + final Moment task = system.getExistingMoment(code); if (task == null) { return Failable. error("No such task " + code); } diff --git a/src/net/sourceforge/plantuml/project3/ComplementSeveralDays.java b/src/net/sourceforge/plantuml/project3/ComplementSeveralDays.java index fd6e20c35..5d2ea18c9 100644 --- a/src/net/sourceforge/plantuml/project3/ComplementSeveralDays.java +++ b/src/net/sourceforge/plantuml/project3/ComplementSeveralDays.java @@ -44,16 +44,20 @@ public class ComplementSeveralDays implements ComplementPattern { public IRegex toRegex(String suffix) { return new RegexConcat( // - new RegexLeaf("COMPLEMENT" + suffix, "(\\d+)[%s]+days?"), // + new RegexLeaf("COMPLEMENT" + suffix, "(\\d+)[%s]+(days?|weeks?)"), // new RegexLeaf("LOAD" + suffix, "([%s]+at[%s]+(\\d+)%)?")); } public Failable getComplement(GanttDiagram system, RegexResult arg, String suffix) { - final String days = arg.get("COMPLEMENT" + suffix, 0); + final String number = arg.get("COMPLEMENT" + suffix, 0); + final boolean inWeeks = arg.get("COMPLEMENT" + suffix, 1).startsWith("w"); + final int factor = inWeeks ? system.daysInWeek() : 1; final String load = arg.get("LOAD" + suffix, 1); + final int days = Integer.parseInt(number) * factor; if (load == null) { - return Failable. ok(LoadInDays.inDay(Integer.parseInt(days))); + return Failable. ok(LoadInDays.inDay(days)); } - return Failable. ok(LoadInDays.inDayWithLoad(Integer.parseInt(days), Integer.parseInt(load))); + return Failable. ok(LoadInDays.inDayWithLoad(days, Integer.parseInt(load))); } + } diff --git a/src/net/sourceforge/plantuml/project3/GanttArrow.java b/src/net/sourceforge/plantuml/project3/GanttArrow.java index d48659c41..20ce44189 100644 --- a/src/net/sourceforge/plantuml/project3/GanttArrow.java +++ b/src/net/sourceforge/plantuml/project3/GanttArrow.java @@ -79,8 +79,8 @@ public class GanttArrow implements UDrawable { ug = ug.apply(new UChangeBackColor(HtmlColorUtils.RED_DARK)).apply(new UChangeColor(HtmlColorUtils.RED_DARK)) .apply(new UStroke(1.5)); - final TaskDraw draw1 = source.getTask().getTaskDraw(); - final TaskDraw draw2 = dest.getTask().getTaskDraw(); + final TaskDraw draw1 = ((Task) source.getMoment()).getTaskDraw(); + final TaskDraw draw2 = ((Task) dest.getMoment()).getTaskDraw(); double x1 = getX(source.withDelta(0), atStart); double y1 = draw1.getY(atStart); diff --git a/src/net/sourceforge/plantuml/project3/GanttDiagram.java b/src/net/sourceforge/plantuml/project3/GanttDiagram.java index 3308389ac..48a1c811f 100644 --- a/src/net/sourceforge/plantuml/project3/GanttDiagram.java +++ b/src/net/sourceforge/plantuml/project3/GanttDiagram.java @@ -357,20 +357,53 @@ public class GanttDiagram extends AbstractPSystem implements Subject { private void initMinMax() { // min = tasks.values().iterator().next().getStart(); - max = tasks.values().iterator().next().getEnd(); - for (Task task : tasks.values()) { - if (task instanceof TaskSeparator) { - continue; - } - final Instant start = task.getStart(); - final Instant end = task.getEnd(); - // if (min.compareTo(start) > 0) { - // min = start; - // } - if (max.compareTo(end) < 0) { - max = end; + if (tasks.size() == 0) { + max = min.increment(); + } else { + max = tasks.values().iterator().next().getEnd(); + for (Task task : tasks.values()) { + if (task instanceof TaskSeparator) { + continue; + } + final Instant start = task.getStart(); + final Instant end = task.getEnd(); + // if (min.compareTo(start) > 0) { + // min = start; + // } + if (max.compareTo(end) < 0) { + max = end; + } } } + if (calendar != null) { + for (DayAsDate d : colorDays.keySet()) { + final Instant instant = calendar.fromDayAsDate(d); + if (instant.compareTo(max) > 0) { + max = instant; + } + } + for (DayAsDate d : nameDays.keySet()) { + final Instant instant = calendar.fromDayAsDate(d); + if (instant.compareTo(max) > 0) { + max = instant; + } + } + } + } + + public DayAsDate getThenDate() { + DayAsDate result = getStartingDate(); + for (DayAsDate d : colorDays.keySet()) { + if (d.compareTo(result) > 0) { + result = d; + } + } + for (DayAsDate d : nameDays.keySet()) { + if (d.compareTo(result) > 0) { + result = d; + } + } + return result; } private void drawTasks(final UGraphic ug, TimeScale timeScale) { @@ -494,6 +527,10 @@ public class GanttDiagram extends AbstractPSystem implements Subject { return this.calendar.getStartingDate(); } + public int daysInWeek() { + return 7 - closedDayOfWeek.size(); + } + public void closeDayOfWeek(DayOfWeek day) { closedDayOfWeek.add(day); } @@ -541,6 +578,45 @@ public class GanttDiagram extends AbstractPSystem implements Subject { private final Map colorDays = new HashMap(); private final Map nameDays = new HashMap(); + public Moment getExistingMoment(String id) { + Moment result = getExistingTask(id); + if (result == null) { + DayAsDate start = null; + DayAsDate end = null; + for (Map.Entry ent : nameDays.entrySet()) { + if (ent.getValue().equalsIgnoreCase(id) == false) { + continue; + } + start = min(start, ent.getKey()); + end = max(end, ent.getKey()); + } + if (start != null) { + result = new MomentImpl(convert(start), convert(end)); + } + } + return result; + } + + private DayAsDate min(DayAsDate d1, DayAsDate d2) { + if (d1 == null) { + return d2; + } + if (d1.compareTo(d2) > 0) { + return d2; + } + return d1; + } + + private DayAsDate max(DayAsDate d1, DayAsDate d2) { + if (d1 == null) { + return d2; + } + if (d1.compareTo(d2) < 0) { + return d2; + } + return d1; + } + public void colorDay(DayAsDate day, HtmlColor color) { colorDays.put(day, color); } diff --git a/src/net/sourceforge/plantuml/project3/SubjectDaysAsDates.java b/src/net/sourceforge/plantuml/project3/SubjectDaysAsDates.java index 5a9d63f0c..addd90056 100644 --- a/src/net/sourceforge/plantuml/project3/SubjectDaysAsDates.java +++ b/src/net/sourceforge/plantuml/project3/SubjectDaysAsDates.java @@ -51,7 +51,7 @@ public class SubjectDaysAsDates implements SubjectPattern { } public IRegex toRegex() { - return new RegexOr(regexTo(), regexAnd()); + return new RegexOr(regexTo(), regexAnd(), regexThen()); } @@ -79,22 +79,37 @@ public class SubjectDaysAsDates implements SubjectPattern { new RegexLeaf("\\D"), // new RegexLeaf("DAY3", "([\\d]{1,2})"), // new RegexLeaf("[%s]+and[%s]+"), // - new RegexLeaf("COUNT", "([\\d]+)"), // + new RegexLeaf("COUNT_AND", "([\\d]+)"), // + new RegexLeaf("[%s]+days?") // + + ); + } + + private IRegex regexThen() { + return new RegexConcat( // + new RegexLeaf("then[%s]+"), // + new RegexLeaf("COUNT_THEN", "([\\d]+)"), // new RegexLeaf("[%s]+days?") // ); } public Subject getSubject(GanttDiagram project, RegexResult arg) { - final String count = arg.get("COUNT", 0); - if (count == null) { - final DayAsDate date1 = getDate(arg, "1"); - final DayAsDate date2 = getDate(arg, "2"); - return new DaysAsDates(date1, date2); + final String countAnd = arg.get("COUNT_AND", 0); + if (countAnd != null) { + final DayAsDate date3 = getDate(arg, "3"); + final int nb = Integer.parseInt(countAnd); + return new DaysAsDates(project, date3, nb); } - final DayAsDate date3 = getDate(arg, "3"); - final int nb = Integer.parseInt(count); - return new DaysAsDates(project, date3, nb); + final String countThen = arg.get("COUNT_THEN", 0); + if (countThen != null) { + final DayAsDate date3 = project.getThenDate(); + final int nb = Integer.parseInt(countThen); + return new DaysAsDates(project, date3, nb); + } + final DayAsDate date1 = getDate(arg, "1"); + final DayAsDate date2 = getDate(arg, "2"); + return new DaysAsDates(date1, date2); } private DayAsDate getDate(RegexResult arg, String suffix) { diff --git a/src/net/sourceforge/plantuml/project3/Task.java b/src/net/sourceforge/plantuml/project3/Task.java index 770eb0978..fc42f26a4 100644 --- a/src/net/sourceforge/plantuml/project3/Task.java +++ b/src/net/sourceforge/plantuml/project3/Task.java @@ -35,7 +35,7 @@ */ package net.sourceforge.plantuml.project3; -public interface Task extends Subject { +public interface Task extends Subject, Moment { public TaskCode getCode(); diff --git a/src/net/sourceforge/plantuml/project3/TaskInstant.java b/src/net/sourceforge/plantuml/project3/TaskInstant.java index c74fd6d67..6d405944b 100644 --- a/src/net/sourceforge/plantuml/project3/TaskInstant.java +++ b/src/net/sourceforge/plantuml/project3/TaskInstant.java @@ -37,15 +37,15 @@ package net.sourceforge.plantuml.project3; public class TaskInstant implements Complement { - private final Task task; + private final Moment task; private final TaskAttribute attribute; private final int delta; - public TaskInstant(Task task, TaskAttribute attribute) { + public TaskInstant(Moment task, TaskAttribute attribute) { this(task, attribute, 0); } - private TaskInstant(Task task, TaskAttribute attribute, int delta) { + private TaskInstant(Moment task, TaskAttribute attribute, int delta) { this.task = task; this.attribute = attribute; this.delta = delta; @@ -97,10 +97,14 @@ public class TaskInstant implements Complement { return attribute.toString() + " of " + task; } - public final Task getTask() { + public final Moment getMoment() { return task; } + public final boolean isTask() { + return task instanceof Task; + } + public final TaskAttribute getAttribute() { return attribute; } diff --git a/src/net/sourceforge/plantuml/project3/VerbTaskStarts.java b/src/net/sourceforge/plantuml/project3/VerbTaskStarts.java index 3cec23abd..e8e7445a9 100644 --- a/src/net/sourceforge/plantuml/project3/VerbTaskStarts.java +++ b/src/net/sourceforge/plantuml/project3/VerbTaskStarts.java @@ -59,7 +59,9 @@ public class VerbTaskStarts implements VerbPattern { final Task task = (Task) subject; final TaskInstant when = (TaskInstant) complement; task.setStart(when.getInstantPrecise()); - project.addContraint(new GanttConstraint(when, new TaskInstant(task, TaskAttribute.START))); + if (when.isTask()) { + project.addContraint(new GanttConstraint(when, new TaskInstant(task, TaskAttribute.START))); + } return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java index ba86a48c0..4f8fa0b18 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java +++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java @@ -152,16 +152,19 @@ public class CommandArrow extends SingleLineCommand2 { final boolean hasDressing2 = contains(dressing2, ">", "\\", "/", "x"); final boolean hasDressing1 = contains(dressing1, "x", "<", "\\", "/"); + final boolean reverseDefine; if (hasDressing2) { p1 = getOrCreateParticipant(diagram, arg, "PART1"); p2 = getOrCreateParticipant(diagram, arg, "PART2"); circleAtStart = dressing1.contains("o"); circleAtEnd = dressing2.contains("o"); + reverseDefine = false; } else if (hasDressing1) { p2 = getOrCreateParticipant(diagram, arg, "PART1"); p1 = getOrCreateParticipant(diagram, arg, "PART2"); circleAtStart = dressing2.contains("o"); circleAtEnd = dressing1.contains("o"); + reverseDefine = true; } else { return CommandExecutionResult.error("Illegal sequence arrow"); @@ -202,11 +205,13 @@ public class CommandArrow extends SingleLineCommand2 { } if (dressing1.contains("x")) { config = config.withHead2(ArrowHead.CROSSX); - } if (dressing2.contains("x")) { config = config.withHead2(ArrowHead.CROSSX); } + if (reverseDefine) { + config = config.reverseDefine(); + } config = applyStyle(arg.getLazzy("ARROW_STYLE", 0), config); diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandReturn.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandReturn.java index 961d61df6..50f21dab1 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandReturn.java +++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandReturn.java @@ -35,10 +35,11 @@ */ package net.sourceforge.plantuml.sequencediagram.command; -import java.util.List; - import net.sourceforge.plantuml.command.CommandExecutionResult; -import net.sourceforge.plantuml.command.SingleLineCommand; +import net.sourceforge.plantuml.command.SingleLineCommand2; +import net.sourceforge.plantuml.command.regex.RegexConcat; +import net.sourceforge.plantuml.command.regex.RegexLeaf; +import net.sourceforge.plantuml.command.regex.RegexResult; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.sequencediagram.EventWithDeactivate; import net.sourceforge.plantuml.sequencediagram.LifeEventType; @@ -47,34 +48,48 @@ import net.sourceforge.plantuml.sequencediagram.SequenceDiagram; import net.sourceforge.plantuml.skin.ArrowBody; import net.sourceforge.plantuml.skin.ArrowConfiguration; -public class CommandReturn extends SingleLineCommand { +public class CommandReturn extends SingleLineCommand2 { public CommandReturn() { - super("(?i)^return[%s]*(.*)$"); + super(getRegexConcat()); + } + + private static RegexConcat getRegexConcat() { + return new RegexConcat(new RegexLeaf("^"), // + new RegexLeaf("PARALLEL", "(&%s*)?"), // + new RegexLeaf("[%s]*"), // + new RegexLeaf("return[%s]*"), // + new RegexLeaf("MESSAGE", "(.*)"), // + new RegexLeaf("$")); } @Override - protected CommandExecutionResult executeArg(SequenceDiagram sequenceDiagram, List arg) { + protected CommandExecutionResult executeArg(SequenceDiagram sequenceDiagram, RegexResult arg) { - Message message = sequenceDiagram.getActivatingMessage(); + Message message1 = sequenceDiagram.getActivatingMessage(); boolean doDeactivation = true; - if (message == null) { + if (message1 == null) { final EventWithDeactivate last = sequenceDiagram.getLastEventWithDeactivate(); if (last instanceof Message == false) { return CommandExecutionResult.error("Nowhere to return to."); } - message = (Message) last; + message1 = (Message) last; doDeactivation = false; } - final ArrowConfiguration arrow = message.getArrowConfiguration().withBody(ArrowBody.DOTTED); + final ArrowConfiguration arrow = message1.getArrowConfiguration().withBody(ArrowBody.DOTTED); - sequenceDiagram.addMessage( - new Message(message.getParticipant2(), message.getParticipant1(), Display.getWithNewlines(arg - .get(0)), arrow, sequenceDiagram.getNextMessageNumber())); + final Display display = Display.getWithNewlines(arg.get("MESSAGE", 0)); + final Message message2 = new Message(message1.getParticipant2(), message1.getParticipant1(), display, arrow, + sequenceDiagram.getNextMessageNumber()); + final boolean parallel = arg.get("PARALLEL", 0) != null; + if (parallel) { + message2.goParallel(); + } + sequenceDiagram.addMessage(message2); if (doDeactivation) { - final String error = sequenceDiagram.activate(message.getParticipant2(), LifeEventType.DEACTIVATE, null); + final String error = sequenceDiagram.activate(message1.getParticipant2(), LifeEventType.DEACTIVATE, null); if (error != null) { return CommandExecutionResult.error(error); } diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java index 13392dcd4..9be36c013 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java +++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java @@ -36,6 +36,7 @@ package net.sourceforge.plantuml.sequencediagram.graphic; import java.awt.geom.Dimension2D; +import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -50,7 +51,9 @@ import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineParam; import net.sourceforge.plantuml.SkinParamBackcolored; import net.sourceforge.plantuml.Url; +import net.sourceforge.plantuml.graphic.InnerStrategy; import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.sequencediagram.Englober; import net.sourceforge.plantuml.sequencediagram.Event; import net.sourceforge.plantuml.sequencediagram.Newpage; @@ -62,6 +65,7 @@ import net.sourceforge.plantuml.skin.ComponentType; import net.sourceforge.plantuml.skin.Context2D; import net.sourceforge.plantuml.skin.SimpleContext2D; import net.sourceforge.plantuml.skin.Skin; +import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UClip; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UStroke; @@ -244,32 +248,57 @@ public class DrawableSet { return dimension; } + TextBlock asTextBlock(final double delta, final double width, final Page page, final boolean showTail) { + return new TextBlock() { + + public void drawU(UGraphic ug) { + drawU22(ug, delta, width, page, showTail); + } + + public Dimension2D calculateDimension(StringBounder stringBounder) { + final double height = page.getHeight(); + return new Dimension2DDouble(width, height); + } + + public MinMax getMinMax(StringBounder stringBounder) { + throw new UnsupportedOperationException(); + } + + public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) { + throw new UnsupportedOperationException(); + } + + }; + + } + void drawU22(final UGraphic ug, final double delta, double width, Page page, boolean showTail) { - // final UGraphic ugOrig = ug; final double height = page.getHeight(); final UGraphic ugTranslated = clipAndTranslate2(delta, width, page, ug); final SimpleContext2D context = new SimpleContext2D(true); this.drawEnglobers(ug, height - MARGIN_FOR_ENGLOBERS1, context); this.drawPlaygroundU(ugTranslated, context); - // ug = ugOrig; - this.drawLineU22(ug, showTail, page); this.drawHeadTailU(ug, page, showTail ? height - getTailHeight(ug.getStringBounder(), true) : 0); - // ug = clipAndTranslate2(delta, width, page, ug); this.drawPlaygroundU(ugTranslated, new SimpleContext2D(false)); } private UGraphic clipAndTranslate2(final double delta, double width, Page p, UGraphic ug) { ug = ug.apply(new UClip(0, p.getBodyRelativePosition(), width, p.getBodyHeight() + 1)); - if (delta > 0) { - ug = ug.apply(new UTranslate(0, -delta)); - } + ug = ug.apply(getTranslate4(delta)); return ug; } + private UTranslate getTranslate4(final double delta) { + if (delta > 0) { + return new UTranslate(0, -delta); + } + return new UTranslate(); + } + private void drawLineU22(UGraphic ug, boolean showTail, Page page) { // http://plantuml.sourceforge.net/qa/?qa=4826/lifelines-broken-for-txt-seq-diagrams-when-create-is-used final boolean isTxt = ug instanceof UGraphicTxt; diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java index 80dc78413..e4e4b1346 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java +++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java @@ -147,7 +147,8 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker { final SequenceDiagramArea area = new SequenceDiagramArea(fullDimension.getWidth(), page.getHeight()); final TextBlock compTitle; - final TextBlock caption = new AnnotatedWorker(diagram, diagram.getSkinParam()).getCaption(); + final AnnotatedWorker annotatedWorker = new AnnotatedWorker(diagram, diagram.getSkinParam(), stringBounder); + final TextBlock caption = annotatedWorker.getCaption(); area.setCaptionArea(caption.calculateDimension(stringBounder)); if (Display.isNull(page.getTitle())) { @@ -211,8 +212,12 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker { if (legendTop) { sequenceAreaY += legendBlock.calculateDimension(ug.getStringBounder()).getHeight(); } - drawableSet.drawU22(ug.apply(new UTranslate(area.getSequenceAreaX() + delta1 / 2, sequenceAreaY)), - delta, fullDimension.getWidth(), page, diagram.isShowFootbox()); + final UTranslate forCore = new UTranslate(area.getSequenceAreaX() + delta1 / 2, sequenceAreaY); + TextBlock core = drawableSet.asTextBlock(delta, fullDimension.getWidth(), page, diagram.isShowFootbox()); + core = annotatedWorker.addFrame(core); + core.drawU(ug.apply(forCore)); + // drawableSet.drawU22(ug.apply(forCore), delta, fullDimension.getWidth(), page, + // diagram.isShowFootbox()); drawHeader(area, ug, index); drawFooter(area, ug, index); diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java index b3edc6766..4f2b360eb 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java +++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java @@ -84,7 +84,7 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker { this.skin = skin; this.footer = getFooterOrHeader(FontParam.FOOTER); this.header = getFooterOrHeader(FontParam.HEADER); - this.annotatedWorker = new AnnotatedWorker(sequenceDiagram, sequenceDiagram.getSkinParam()); + this.annotatedWorker = new AnnotatedWorker(sequenceDiagram, sequenceDiagram.getSkinParam(), stringBounder); this.main = new MainTileAdapter(createMainTile()); this.min1 = ((MainTileAdapter) main).getMinX(stringBounder); diff --git a/src/net/sourceforge/plantuml/skin/ArrowConfiguration.java b/src/net/sourceforge/plantuml/skin/ArrowConfiguration.java index 333f0619d..fe5fa75bb 100644 --- a/src/net/sourceforge/plantuml/skin/ArrowConfiguration.java +++ b/src/net/sourceforge/plantuml/skin/ArrowConfiguration.java @@ -53,12 +53,15 @@ public class ArrowConfiguration { private final boolean isSelf; private final double thickness; + private final boolean reverseDefine; private ArrowConfiguration(ArrowBody body, ArrowDressing dressing1, ArrowDressing dressing2, - ArrowDecoration decoration1, ArrowDecoration decoration2, HtmlColor color, boolean isSelf, double thickness) { + ArrowDecoration decoration1, ArrowDecoration decoration2, HtmlColor color, boolean isSelf, + double thickness, boolean reverseDefine) { if (body == null || dressing1 == null || dressing2 == null) { throw new IllegalArgumentException(); } + this.reverseDefine = reverseDefine; this.thickness = thickness; this.body = body; this.dressing1 = dressing1; @@ -81,19 +84,19 @@ public class ArrowConfiguration { public static ArrowConfiguration withDirectionNormal() { return new ArrowConfiguration(ArrowBody.NORMAL, ArrowDressing.create(), ArrowDressing.create().withHead( - ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null, false, 1); + ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null, false, 1, false); } public static ArrowConfiguration withDirectionBoth() { return new ArrowConfiguration(ArrowBody.NORMAL, ArrowDressing.create().withHead(ArrowHead.NORMAL), ArrowDressing.create().withHead(ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null, - false, 1); + false, 1, false); } public static ArrowConfiguration withDirectionSelf() { return new ArrowConfiguration(ArrowBody.NORMAL, ArrowDressing.create().withHead(ArrowHead.NORMAL), ArrowDressing.create().withHead(ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null, - true, 1); + true, 1, false); } public static ArrowConfiguration withDirectionReverse() { @@ -101,22 +104,25 @@ public class ArrowConfiguration { } public ArrowConfiguration reverse() { - return new ArrowConfiguration(body, dressing2, dressing1, decoration2, decoration1, color, isSelf, thickness); + return new ArrowConfiguration(body, dressing2, dressing1, decoration2, decoration1, color, isSelf, thickness, + reverseDefine); } public ArrowConfiguration self() { - return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, true, thickness); + return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, true, thickness, + reverseDefine); } public ArrowConfiguration withBody(ArrowBody type) { - return new ArrowConfiguration(type, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness); + return new ArrowConfiguration(type, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness, + reverseDefine); } public ArrowConfiguration withHead(ArrowHead head) { final ArrowDressing newDressing1 = addHead(dressing1, head); final ArrowDressing newDressing2 = addHead(dressing2, head); return new ArrowConfiguration(body, newDressing1, newDressing2, decoration1, decoration2, color, isSelf, - thickness); + thickness, reverseDefine); } private static ArrowDressing addHead(ArrowDressing dressing, ArrowHead head) { @@ -128,33 +134,36 @@ public class ArrowConfiguration { public ArrowConfiguration withHead1(ArrowHead head) { return new ArrowConfiguration(body, dressing1.withHead(head), dressing2, decoration1, decoration2, color, - isSelf, thickness); + isSelf, thickness, reverseDefine); } public ArrowConfiguration withHead2(ArrowHead head) { return new ArrowConfiguration(body, dressing1, dressing2.withHead(head), decoration1, decoration2, color, - isSelf, thickness); + isSelf, thickness, reverseDefine); } public ArrowConfiguration withPart(ArrowPart part) { if (dressing2.getHead() != ArrowHead.NONE) { return new ArrowConfiguration(body, dressing1, dressing2.withPart(part), decoration1, decoration2, color, - isSelf, thickness); + isSelf, thickness, reverseDefine); } return new ArrowConfiguration(body, dressing1.withPart(part), dressing2, decoration1, decoration2, color, - isSelf, thickness); + isSelf, thickness, reverseDefine); } public ArrowConfiguration withDecoration1(ArrowDecoration decoration1) { - return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness); + return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness, + reverseDefine); } public ArrowConfiguration withDecoration2(ArrowDecoration decoration2) { - return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness); + return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness, + reverseDefine); } public ArrowConfiguration withColor(HtmlColor color) { - return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness); + return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness, + reverseDefine); } public final ArrowDecoration getDecoration1() { @@ -236,7 +245,17 @@ public class ArrowConfiguration { } public ArrowConfiguration withThickness(double thickness) { - return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness); + return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness, + reverseDefine); + } + + public ArrowConfiguration reverseDefine() { + return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness, + !reverseDefine); + } + + public final boolean isReverseDefine() { + return reverseDefine; } } diff --git a/src/net/sourceforge/plantuml/skin/rose/Rose.java b/src/net/sourceforge/plantuml/skin/rose/Rose.java index 4c1b46d23..c0494939e 100644 --- a/src/net/sourceforge/plantuml/skin/rose/Rose.java +++ b/src/net/sourceforge/plantuml/skin/rose/Rose.java @@ -100,9 +100,9 @@ public class Rose implements Skin { config, param, param.maxMessageSize(), param.strictUmlStyle() == false); } final HorizontalAlignment messageHorizontalAlignment = param.getHorizontalAlignment( - AlignmentParam.sequenceMessageAlignment, config.getArrowDirection()); + AlignmentParam.sequenceMessageAlignment, config.getArrowDirection(), config.isReverseDefine()); final HorizontalAlignment textHorizontalAlignment = param.getHorizontalAlignment( - AlignmentParam.sequenceMessageTextAlignment, config.getArrowDirection()); + AlignmentParam.sequenceMessageTextAlignment, config.getArrowDirection(), false); return new ComponentRoseArrow(sequenceArrow, getUFont2(param, FontParam.ARROW), stringsToDisplay, config, messageHorizontalAlignment, param, textHorizontalAlignment, param.maxMessageSize(), param.strictUmlStyle() == false, param.responseMessageBelowArrow()); @@ -198,17 +198,17 @@ public class Rose implements Skin { FontParam.DATABASE_STEREOTYPE)); } if (type == ComponentType.NOTE) { - final HorizontalAlignment alignment = param.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null); + final HorizontalAlignment alignment = param.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null, false); return new ComponentRoseNote(getSymbolContext(param, ColorParam.noteBorder), getUFont2(param, FontParam.NOTE), stringsToDisplay, paddingX, paddingY, param, roundCorner, alignment); } if (type == ComponentType.NOTE_HEXAGONAL) { - final HorizontalAlignment alignment = param.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null); + final HorizontalAlignment alignment = param.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null, false); return new ComponentRoseNoteHexagonal(getSymbolContext(param, ColorParam.noteBorder), getUFont2(param, FontParam.NOTE), stringsToDisplay, param, alignment); } if (type == ComponentType.NOTE_BOX) { - final HorizontalAlignment alignment = param.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null); + final HorizontalAlignment alignment = param.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null, false); return new ComponentRoseNoteBox(getSymbolContext(param, ColorParam.noteBorder), getUFont2(param, FontParam.NOTE), stringsToDisplay, param, alignment); } @@ -261,7 +261,7 @@ public class Rose implements Skin { if (type == ComponentType.REFERENCE) { return new ComponentRoseReference(getUFont2(param, FontParam.SEQUENCE_REFERENCE), getSymbolContext(param, ColorParam.sequenceReferenceBorder), bigFont, stringsToDisplay, param.getHorizontalAlignment( - AlignmentParam.sequenceReferenceAlignment, null), param, getHtmlColor(param, + AlignmentParam.sequenceReferenceAlignment, null, false), param, getHtmlColor(param, ColorParam.sequenceReferenceBackground)); } // if (type == ComponentType.TITLE) { diff --git a/src/net/sourceforge/plantuml/svek/Cluster.java b/src/net/sourceforge/plantuml/svek/Cluster.java index 97cb57494..4b6dfd51f 100644 --- a/src/net/sourceforge/plantuml/svek/Cluster.java +++ b/src/net/sourceforge/plantuml/svek/Cluster.java @@ -365,7 +365,7 @@ public class Cluster implements Moveable { final ClusterDecoration decoration = new ClusterDecoration(style, group.getUSymbol(), ztitle, zstereo, minX, minY, maxX, maxY, stroke2); decoration.drawU(ug, back, borderColor, shadowing, roundCorner, - skinParam2.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null)); + skinParam2.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false)); return; } final URectangle rect = new URectangle(maxX - minX, maxY - minY); @@ -742,7 +742,7 @@ public class Cluster implements Moveable { sblabel.append(">"); label = sblabel.toString(); final HorizontalAlignment align = skinParam.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, - null); + null, false); sb.append("labeljust=\"" + align.getGraphVizValue() + "\";"); } else { label = "\"\""; diff --git a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java index fa01bce6d..2d5e16f86 100644 --- a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java +++ b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java @@ -109,7 +109,8 @@ public final class CucaDiagramFileMakerSvek implements CucaDiagramFileMaker { result = svek2.buildImage(basefile, diagram.getDotStringSkek()); } final boolean isGraphvizCrash = result instanceof GraphvizCrash; - result = new AnnotatedWorker(diagram, diagram.getSkinParam()).addAdd(result); + result = new AnnotatedWorker(diagram, diagram.getSkinParam(), fileFormatOption.getDefaultStringBounder()) + .addAdd(result); final String widthwarning = diagram.getSkinParam().getValue("widthwarning"); String warningOrError = null; diff --git a/src/net/sourceforge/plantuml/svek/GraphvizCrash.java b/src/net/sourceforge/plantuml/svek/GraphvizCrash.java index cdf7e6a96..d2d45005f 100644 --- a/src/net/sourceforge/plantuml/svek/GraphvizCrash.java +++ b/src/net/sourceforge/plantuml/svek/GraphvizCrash.java @@ -151,7 +151,7 @@ public class GraphvizCrash extends AbstractTextBlock implements IEntityImage { public static void addDecodeHint(final List strings) { strings.add(" "); - strings.add(" Diagram source: (Use http://zxing.org/w/decode.jspx to decode the flashcode)"); + strings.add(" Diagram source: (Use http://zxing.org/w/decode.jspx to decode the qrcode)"); } public static void addProperties(final List strings) { diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java b/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java index 90e83eb0c..9afccfb1e 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageClass.java @@ -165,8 +165,8 @@ public class EntityImageClass extends AbstractEntityImage implements Stencil, Wi headerBackcolor = getSkinParam().getHtmlColor(ColorParam.classHeaderBackground, getStereo(), false); } UGraphic ugHeader = ug; - if (headerBackcolor != null) { - final Shadowable rect2 = new URectangle(widthTotal, dimHeader.getHeight()); + if (headerBackcolor != null && roundCorner == 0) { + final Shadowable rect2 = new URectangle(widthTotal, dimHeader.getHeight(), roundCorner, roundCorner); ugHeader = ugHeader.apply(new UChangeBackColor(headerBackcolor)); ugHeader.apply(stroke).draw(rect2); } diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java b/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java index 012876382..b0aec1548 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java @@ -56,6 +56,7 @@ import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HtmlColor; +import net.sourceforge.plantuml.graphic.SkinParameter; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.SymbolContext; import net.sourceforge.plantuml.graphic.TextBlock; @@ -111,7 +112,7 @@ public class EntityImageDescription extends AbstractEntityImage { this.hideText = symbol == USymbol.INTERFACE; final Display codeDisplay = Display.getWithNewlines(entity.getCode()); - desc = (entity.getDisplay().equals(codeDisplay) && symbol instanceof USymbolFolder) + desc = (entity.getDisplay().equals(codeDisplay) && symbol.getSkinParameter() == SkinParameter.PACKAGE) || entity.getDisplay().isWhite() ? TextBlockUtils.empty(0, 0) : new BodyEnhanced(entity.getDisplay(), symbol.getFontParam(), getSkinParam(), HorizontalAlignment.LEFT, stereotype, symbol.manageHorizontalLine(), false, entity); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageEmptyPackage.java b/src/net/sourceforge/plantuml/svek/image/EntityImageEmptyPackage.java index 10fddb071..852564bca 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageEmptyPackage.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageEmptyPackage.java @@ -130,7 +130,7 @@ public class EntityImageEmptyPackage extends AbstractEntityImage { decoration.drawU(ug, back, SkinParamUtils.getColor(getSkinParam(), ColorParam.packageBorder, getStereo()), getSkinParam().shadowing(getEntity().getStereotype()), roundCorner, - getSkinParam().getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null)); + getSkinParam().getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false)); if (url != null) { ug.closeAction(); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageState.java b/src/net/sourceforge/plantuml/svek/image/EntityImageState.java index f8d90ebd6..6a9a64b0b 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageState.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageState.java @@ -44,6 +44,7 @@ import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineConfigurable; import net.sourceforge.plantuml.SkinParamUtils; import net.sourceforge.plantuml.Url; +import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.IEntity; import net.sourceforge.plantuml.cucadiagram.Member; @@ -91,7 +92,7 @@ public class EntityImageState extends AbstractEntityImage { this.withSymbol = stereotype != null && stereotype.isWithOOSymbol(); this.desc = entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.STATE, stereotype), - HorizontalAlignment.CENTER, skinParam); + HorizontalAlignment.CENTER, skinParam, CreoleMode.FULL, skinParam.wrapWidth()); Display list = Display.empty(); for (Member att : entity.getBodier().getFieldsToDisplay()) { diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageStateEmptyDescription.java b/src/net/sourceforge/plantuml/svek/image/EntityImageStateEmptyDescription.java index 56d3dc533..c7b0bfe0f 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageStateEmptyDescription.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageStateEmptyDescription.java @@ -43,6 +43,7 @@ import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.SkinParamUtils; import net.sourceforge.plantuml.Url; +import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.IEntity; import net.sourceforge.plantuml.cucadiagram.Member; @@ -76,7 +77,7 @@ public class EntityImageStateEmptyDescription extends AbstractEntityImage { final Stereotype stereotype = entity.getStereotype(); this.desc = entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.STATE, stereotype), - HorizontalAlignment.CENTER, skinParam); + HorizontalAlignment.CENTER, skinParam, CreoleMode.FULL, skinParam.wrapWidth()); Display list = Display.empty(); for (Member att : entity.getBodier().getFieldsToDisplay()) { diff --git a/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java b/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java index 5bd6c09e3..a15ff6fe7 100644 --- a/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java +++ b/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java @@ -154,6 +154,7 @@ public class LanguageDescriptor { keyword.add("order"); keyword.add("allow_mixing"); keyword.add("allowmixing"); + keyword.add("mainframe"); preproc.add("!exit"); preproc.add("!include"); diff --git a/src/net/sourceforge/plantuml/timingdiagram/Histogram.java b/src/net/sourceforge/plantuml/timingdiagram/Histogram.java index 98c1cc032..f8c679dd6 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/Histogram.java +++ b/src/net/sourceforge/plantuml/timingdiagram/Histogram.java @@ -231,7 +231,7 @@ public class Histogram implements TimeDrawing { } private FontConfiguration getFontConfiguration() { - return new FontConfiguration(skinParam, FontParam.ACTIVITY, null); + return new FontConfiguration(skinParam, FontParam.TIMING, null); } private TextBlock getTextBlock(String value) { diff --git a/src/net/sourceforge/plantuml/timingdiagram/Player.java b/src/net/sourceforge/plantuml/timingdiagram/Player.java index 85f189e8e..21e095c1d 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/Player.java +++ b/src/net/sourceforge/plantuml/timingdiagram/Player.java @@ -85,7 +85,7 @@ public class Player implements TextBlock, TimeProjected { } private FontConfiguration getFontConfiguration() { - return new FontConfiguration(skinParam, FontParam.ACTIVITY, null); + return new FontConfiguration(skinParam, FontParam.TIMING, null); } public void drawU(UGraphic ug) { diff --git a/src/net/sourceforge/plantuml/timingdiagram/Ribbon.java b/src/net/sourceforge/plantuml/timingdiagram/Ribbon.java index 0eb61eb36..2ec7f7cb1 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/Ribbon.java +++ b/src/net/sourceforge/plantuml/timingdiagram/Ribbon.java @@ -93,7 +93,7 @@ public class Ribbon implements TimeDrawing { } private FontConfiguration getFontConfiguration() { - return new FontConfiguration(skinParam, FontParam.ACTIVITY, null); + return new FontConfiguration(skinParam, FontParam.TIMING, null); } private TextBlock createTextBlock(String value) { diff --git a/src/net/sourceforge/plantuml/timingdiagram/RibbonNew.java b/src/net/sourceforge/plantuml/timingdiagram/RibbonNew.java index 7e0b3c950..6443479ce 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/RibbonNew.java +++ b/src/net/sourceforge/plantuml/timingdiagram/RibbonNew.java @@ -92,7 +92,7 @@ public class RibbonNew implements TimeDrawing { } private FontConfiguration getFontConfiguration() { - return new FontConfiguration(skinParam, FontParam.ACTIVITY, null); + return new FontConfiguration(skinParam, FontParam.TIMING, null); } private TextBlock createTextBlock(String value) { diff --git a/src/net/sourceforge/plantuml/timingdiagram/RibbonOld.java b/src/net/sourceforge/plantuml/timingdiagram/RibbonOld.java index a0123ed07..c643eb3d3 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/RibbonOld.java +++ b/src/net/sourceforge/plantuml/timingdiagram/RibbonOld.java @@ -90,7 +90,7 @@ public class RibbonOld implements TimeDrawing { } private FontConfiguration getFontConfiguration() { - return new FontConfiguration(skinParam, FontParam.ACTIVITY, null); + return new FontConfiguration(skinParam, FontParam.TIMING, null); } private TextBlock getTextBlock(String value) { diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimingDiagram.java b/src/net/sourceforge/plantuml/timingdiagram/TimingDiagram.java index 1c46d67cc..0987100a1 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/TimingDiagram.java +++ b/src/net/sourceforge/plantuml/timingdiagram/TimingDiagram.java @@ -96,7 +96,7 @@ public class TimingDiagram extends UmlDiagram implements Clock { TextBlock result = getTextBlock(); final ISkinParam skinParam = getSkinParam(); - result = new AnnotatedWorker(this, skinParam).addAdd(result); + result = new AnnotatedWorker(this, skinParam, fileFormatOption.getDefaultStringBounder()).addAdd(result); imageBuilder.setUDrawable(result); return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os); diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimingDiagramFactory.java b/src/net/sourceforge/plantuml/timingdiagram/TimingDiagramFactory.java index 3f35d23e1..54fc1ae2a 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/TimingDiagramFactory.java +++ b/src/net/sourceforge/plantuml/timingdiagram/TimingDiagramFactory.java @@ -39,8 +39,8 @@ import java.util.ArrayList; import java.util.List; import net.sourceforge.plantuml.command.Command; -import net.sourceforge.plantuml.command.UmlDiagramFactory; import net.sourceforge.plantuml.command.CommandFootboxIgnored; +import net.sourceforge.plantuml.command.UmlDiagramFactory; public class TimingDiagramFactory extends UmlDiagramFactory { @@ -53,10 +53,9 @@ public class TimingDiagramFactory extends UmlDiagramFactory { protected List createCommands() { final List cmds = new ArrayList(); - cmds.add(new CommandFootboxIgnored()); addCommonCommands(cmds); - + cmds.add(new CommandFootboxIgnored()); cmds.add(new CommandLifeLine()); cmds.add(new CommandDefineStateShort()); cmds.add(new CommandDefineStateLong()); diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java b/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java index 7e2b63a58..a01ddb0a0 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java +++ b/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java @@ -115,7 +115,7 @@ public class TimingRuler { } private FontConfiguration getFontConfiguration() { - return new FontConfiguration(skinParam, FontParam.ACTIVITY, null); + return new FontConfiguration(skinParam, FontParam.TIMING, null); } private TextBlock getTimeTextBlock(long time) { diff --git a/src/net/sourceforge/plantuml/ugraphic/AbstractUGraphicHorizontalLine.java b/src/net/sourceforge/plantuml/ugraphic/AbstractUGraphicHorizontalLine.java index c3a13341d..c66b62097 100644 --- a/src/net/sourceforge/plantuml/ugraphic/AbstractUGraphicHorizontalLine.java +++ b/src/net/sourceforge/plantuml/ugraphic/AbstractUGraphicHorizontalLine.java @@ -46,6 +46,10 @@ public abstract class AbstractUGraphicHorizontalLine extends UGraphicDelegator { if (change instanceof UTranslate) { result = copy(getUg()); result.translate = this.translate.compose((UTranslate) change); + } else if (change instanceof UClip) { + final UClip clip = ((UClip) change).translate(translate); + result = copy(getUg().apply(clip)); + result.translate = this.translate; } else { result = copy(getUg().apply(change)); result.translate = this.translate; diff --git a/src/net/sourceforge/plantuml/ugraphic/MinMax.java b/src/net/sourceforge/plantuml/ugraphic/MinMax.java index 59fd594e1..1ee58e35d 100644 --- a/src/net/sourceforge/plantuml/ugraphic/MinMax.java +++ b/src/net/sourceforge/plantuml/ugraphic/MinMax.java @@ -142,7 +142,10 @@ public class MinMax { } public void drawGrey(UGraphic ug) { - final HtmlColor color = HtmlColorUtils.GRAY; + draw(ug, HtmlColorUtils.GRAY); + } + + public void draw(UGraphic ug, HtmlColor color) { ug = ug.apply(new UChangeColor(color)).apply(new UChangeBackColor(color)); ug = ug.apply(new UTranslate(minX, minY)); ug.draw(new URectangle(getWidth(), getHeight())); diff --git a/src/net/sourceforge/plantuml/utils/StartUtils.java b/src/net/sourceforge/plantuml/utils/StartUtils.java index 979886e0b..ac296b584 100644 --- a/src/net/sourceforge/plantuml/utils/StartUtils.java +++ b/src/net/sourceforge/plantuml/utils/StartUtils.java @@ -80,6 +80,9 @@ public class StartUtils { public static boolean isArobaseStartDiagram(CharSequence s) { final String s2 = StringUtils.trinNoTrace(s); + if (s2.startsWith("@") == false && s2.startsWith("\\") == false) { + return false; + } return DiagramType.getTypeFromArobaseStart(s2) != DiagramType.UNKNOWN; } @@ -91,6 +94,14 @@ public class StartUtils { return tmp.startsWith("@" + value) || tmp.startsWith("\\" + value); } + public static boolean startOrEnd(final CharSequence2 s) { + final String s2 = StringUtils.trinNoTrace(s); + if (s2.startsWith("@") == false && s2.startsWith("\\") == false) { + return false; + } + return startsWithSymbolAnd("end", s2) || DiagramType.getTypeFromArobaseStart(s2) != DiagramType.UNKNOWN; + } + public static boolean isArobaseEndDiagram(CharSequence s) { final String s2 = StringUtils.trinNoTrace(s); return startsWithSymbolAnd("end", s2); diff --git a/src/net/sourceforge/plantuml/version/License.java b/src/net/sourceforge/plantuml/version/License.java index 03f51fea1..48eabf7e5 100644 --- a/src/net/sourceforge/plantuml/version/License.java +++ b/src/net/sourceforge/plantuml/version/License.java @@ -273,6 +273,7 @@ public enum License { text.add("PlantUML can occasionally display sponsored or advertising messages. Those"); text.add("messages are usually generated on welcome or error images and never on"); text.add("functional diagrams."); + text.add("See http://plantuml.com/professional if you want to remove them"); text.add(" "); } text.add("Images (whatever their format : PNG, SVG, EPS...) generated by running PlantUML"); @@ -283,16 +284,20 @@ public enum License { private List getHeaderStart(LicenseInfo licenseInfo, boolean withQrcode) { final List text = new ArrayList(); if (licenseInfo.isNone()) { - text.add("========================================================================"); - text.add("PlantUML : a free UML diagram generator"); - text.add("========================================================================"); + text.add("+======================================================================="); + text.add("| "); + text.add("| PlantUML : a free UML diagram generator"); + text.add("| "); + text.add("+======================================================================="); text.add(" "); } else { - text.add("========================================================================"); - text.add("This is PlantUML Professional Edition"); - text.add("========================================================================"); + text.add("+======================================================================="); + text.add("| "); + text.add("| PlantUML Professional Edition"); + text.add("| "); + text.add("+======================================================================="); addLicenseInfo(text, licenseInfo); - text.add("========================================================================"); + text.add("+======================================================================="); text.add(" "); } text.add("(C) Copyright 2009-2017, Arnaud Roques"); @@ -303,9 +308,10 @@ public enum License { text.add("If you like this project or if you find it useful, you can support us at:"); text.add(" "); text.add("http://plantuml.com/patreon (only 1$ per month!)"); + text.add("http://plantuml.com/liberapay (only 1\u20ac per month!)"); text.add("http://plantuml.com/paypal"); if (withQrcode) { - text.add("\t\t\t\t\t\t"); + text.add("\t\t\t\t\t"); } else { text.add(""); text.add(" "); @@ -315,10 +321,19 @@ public enum License { } public static void addLicenseInfo(final List text, LicenseInfo licenseInfo) { - text.add("LICENSED TO : " + licenseInfo.getOwner()); - text.add("EXPIRATION DATE : " + DateFormat.getDateInstance().format(licenseInfo.getExpirationDate())); + if (licenseInfo.getLicenseType() == LicenseType.NAMED) { + text.add("| "); + text.add("| LICENSED TO : " + licenseInfo.getOwner()); + text.add("| EXPIRATION DATE : " + DateFormat.getDateInstance().format(licenseInfo.getExpirationDate())); + text.add("| "); + } else if (licenseInfo.getLicenseType() == LicenseType.DISTRIBUTOR) { + text.add("| "); + text.add("| DISTRIBUTED BY : " + licenseInfo.getOwner()); + text.add("| "); + } if (licenseInfo.hasExpired()) { - text.add("Warning: Your license has expired."); + text.add("| Warning: Your license has expired."); + text.add("| "); } } diff --git a/src/net/sourceforge/plantuml/version/LicenseInfo.java b/src/net/sourceforge/plantuml/version/LicenseInfo.java index 0a2e6dcff..83ed2cb22 100644 --- a/src/net/sourceforge/plantuml/version/LicenseInfo.java +++ b/src/net/sourceforge/plantuml/version/LicenseInfo.java @@ -38,8 +38,12 @@ import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; import java.math.BigInteger; import java.security.NoSuchAlgorithmException; +import java.security.spec.InvalidKeySpecException; import java.util.Collection; import java.util.Date; import java.util.Set; @@ -56,34 +60,51 @@ import net.sourceforge.plantuml.dedication.QBlock; public class LicenseInfo { private final static Preferences prefs = Preferences.userNodeForPackage(LicenseInfo.class); - private final static LicenseInfo NONE = new LicenseInfo(); + private final static LicenseInfo NONE = new LicenseInfo(LicenseType.NONE, 0, 0, null, null); public static final int POS_TYPE = 2; + public static final int POS_CONTEXT = 4; public static final int POS_SIGNATURE = 10; public static final int POS_GENERATION = 100; public static final int POS_EXPIRATION = 108; public static final int POS_OWNER = 128; + private final LicenseType type; private final long generationDate; private final long expirationDate; private final String owner; + private final String context; - private LicenseInfo() { - this.expirationDate = 0; - this.generationDate = 0; - this.owner = null; + private LicenseInfo(LicenseType type, long generationDate, long expirationDate, String owner, String context) { + this.type = type; + this.generationDate = generationDate; + this.expirationDate = expirationDate; + this.owner = owner; + this.context = context; } - private LicenseInfo(Magic magic) throws NoSuchAlgorithmException, IOException { + private static LicenseInfo buildNamed(Magic magic, boolean doCheck) throws NoSuchAlgorithmException, IOException { final String signature = SignatureUtils.toHexString(magic.get(LicenseInfo.POS_SIGNATURE, 64)); - final String local = SignatureUtils.toHexString(Magic.signature()); - if (local.equals(signature) == false) { - throw new IOException(); + if (doCheck) { + final String local = SignatureUtils.toHexString(Magic.signature()); + if (local.equals(signature) == false) { + throw new IOException(); + } } - final int type = magic.getByte(Magic.signature(), LicenseInfo.POS_TYPE); - this.generationDate = bytesToLong(magic.get(LicenseInfo.POS_GENERATION, 8)); - this.expirationDate = bytesToLong(magic.get(LicenseInfo.POS_EXPIRATION, 8)); - this.owner = magic.getString(LicenseInfo.POS_OWNER); + final LicenseType type = LicenseType.fromInt(magic.getByte(Magic.signature(), LicenseInfo.POS_TYPE)); + final long generation = bytesToLong(magic.get(LicenseInfo.POS_GENERATION, 8)); + final long expiration = bytesToLong(magic.get(LicenseInfo.POS_EXPIRATION, 8)); + final String owner = magic.getString(LicenseInfo.POS_OWNER); + return new LicenseInfo(type, generation, expiration, owner, null); + } + + private static LicenseInfo buildDistributor(Magic magic) throws IOException, NoSuchAlgorithmException { + final LicenseType type = LicenseType.fromInt(magic.getByte(LicenseInfo.POS_TYPE)); + final long generation = bytesToLong(magic.get(LicenseInfo.POS_GENERATION, 8)); + final long expiration = bytesToLong(magic.get(LicenseInfo.POS_EXPIRATION, 8)); + final String owner = magic.getString(LicenseInfo.POS_OWNER); + final String context = magic.getString(LicenseInfo.POS_CONTEXT); + return new LicenseInfo(type, generation, expiration, owner, context); } public static long bytesToLong(byte[] b) { @@ -104,19 +125,26 @@ public class LicenseInfo { public static synchronized LicenseInfo retrieveQuick() { if (cache == null) { - return retrieveSlow(); + cache = retrieveDistributor(); + } + if (cache == null) { + cache = retrieveNamedSlow(); } return cache; } - public static synchronized LicenseInfo retrieveSlow() { + public static boolean retrieveNamedOrDistributorQuickIsValid() { + return retrieveQuick().isValid(); + } + + public static synchronized LicenseInfo retrieveNamedSlow() { cache = LicenseInfo.NONE; if (OptionFlags.ALLOW_INCLUDE == false) { return cache; } final String key = prefs.get("license", ""); if (key.length() > 0) { - cache = setIfValid(retrieve(key), cache); + cache = setIfValid(retrieveNamed(key), cache); if (cache.isValid()) { return cache; } @@ -138,35 +166,11 @@ public class LicenseInfo { return cache; } - private static LicenseInfo setIfValid(LicenseInfo value, LicenseInfo def) { - if (value.isValid() || def.isNone()) { - return value; - } - return def; - } - - private static LicenseInfo retrieve(File f) throws IOException { - final BufferedReader br = new BufferedReader(new FileReader(f)); - final String s = br.readLine(); - br.close(); - final LicenseInfo result = retrieve(s); - if (result != null) { - Log.info("Reading license from " + f.getAbsolutePath()); - } - return result; - } - - public static LicenseInfo retrieve(final String key) { + public static LicenseInfo retrieveNamed(final String key) { if (key.length() > 99 && key.matches("^[0-9a-z]+$")) { try { - final BigInteger lu = new BigInteger(key, 36); - final QBlock qb2 = new QBlock(lu); - final QBlock qb3 = qb2.change(Dedication.E, Dedication.N); - final Magic magic = qb3.toMagic(); - final String sig = SignatureUtils.toHexString(Magic.signature()); - magic.xor(SignatureUtils.getSHA512raw(SignatureUtils.salting(sig, Magic.getSalt(sig)))); - return new LicenseInfo(magic); + return retrieveNamed(sig, key, true); } catch (Exception e) { // e.printStackTrace(); Log.info("Error retrieving license info" + e); @@ -175,6 +179,46 @@ public class LicenseInfo { return LicenseInfo.NONE; } + public static LicenseInfo retrieveNamed(final String sig, final String key, boolean doCheck) + throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeySpecException, IOException { + final BigInteger lu = new BigInteger(key, 36); + final QBlock qb2 = new QBlock(lu); + final QBlock qb3 = qb2.change(Dedication.E, Dedication.N); + final Magic magic = qb3.toMagic(); + + magic.xor(SignatureUtils.getSHA512raw(SignatureUtils.salting(sig, Magic.getSalt(sig)))); + return LicenseInfo.buildNamed(magic, doCheck); + } + + public static LicenseInfo retrieveDistributor() { + final InputStream dis = PSystemVersion.class.getResourceAsStream("/distributor.txt"); + if (dis == null) { + return null; + } + try { + final BufferedReader br = new BufferedReader(new InputStreamReader(dis)); + final String licenseString = br.readLine(); + br.close(); + final BigInteger lu = new BigInteger(licenseString, 36); + final QBlock qb2 = new QBlock(lu); + final QBlock qb3 = qb2.change(Dedication.E, Dedication.N); + final Magic magic = qb3.toMagic(); + final LicenseInfo result = LicenseInfo.buildDistributor(magic); + + final Throwable creationPoint = new Throwable(); + creationPoint.fillInStackTrace(); + for (StackTraceElement ste : creationPoint.getStackTrace()) { + if (ste.toString().contains(result.context)) { + return result; + } + } + return null; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + public static Collection fileCandidates() { final Set result = new TreeSet(); final String classpath = System.getProperty("java.class.path"); @@ -190,9 +234,29 @@ public class LicenseInfo { } return result; } + + private static LicenseInfo setIfValid(LicenseInfo value, LicenseInfo def) { + if (value.isValid() || def.isNone()) { + return value; + } + return def; + } + + private static LicenseInfo retrieve(File f) throws IOException { + final BufferedReader br = new BufferedReader(new FileReader(f)); + final String s = br.readLine(); + br.close(); + final LicenseInfo result = retrieveNamed(s); + if (result != null) { + Log.info("Reading license from " + f.getAbsolutePath()); + } + return result; + } + + public static void main(String[] args) { - LicenseInfo info = retrieveSlow(); + LicenseInfo info = retrieveNamedSlow(); System.err.println("valid=" + info.isValid()); System.err.println("info=" + info.owner); @@ -222,4 +286,12 @@ public class LicenseInfo { return owner != null && System.currentTimeMillis() > this.expirationDate; } + public final LicenseType getLicenseType() { + return type; + } + + public final String getContext() { + return context; + } + } diff --git a/src/net/sourceforge/plantuml/version/Magic.java b/src/net/sourceforge/plantuml/version/Magic.java index a5e7d2c8e..abf1275ee 100644 --- a/src/net/sourceforge/plantuml/version/Magic.java +++ b/src/net/sourceforge/plantuml/version/Magic.java @@ -83,6 +83,10 @@ public class Magic { return buffer; } + public void setByte(int pos, int data) { + buffer[pos] = (byte) (0xFF & data); + } + public void setByte(byte[] shrink, int pos, int data) { buffer[pos] = (byte) (0xFF & (data ^ shrink(shrink))); } @@ -91,6 +95,10 @@ public class Magic { return buffer[pos] ^ shrink(shrink); } + public int getByte(int pos) { + return buffer[pos]; + } + public void set(int pos, byte[] data) { for (int i = 0; i < data.length; i++) { buffer[pos + i] = data[i]; diff --git a/src/net/sourceforge/plantuml/version/PSystemKeygen.java b/src/net/sourceforge/plantuml/version/PSystemKeygen.java index f45043c9c..15a422e82 100644 --- a/src/net/sourceforge/plantuml/version/PSystemKeygen.java +++ b/src/net/sourceforge/plantuml/version/PSystemKeygen.java @@ -88,16 +88,16 @@ public class PSystemKeygen extends AbstractPSystem { } public DiagramDescription getDescription() { - return new DiagramDescription("(Genkey)"); + return new DiagramDescription("(Key)"); } private void drawInternal(UGraphic ug) throws IOException { - final LicenseInfo installed = LicenseInfo.retrieveSlow(); + final LicenseInfo installed = LicenseInfo.retrieveNamedSlow(); if (key.length() == 0) { drawFlash(ug, installed); return; } - final LicenseInfo info = LicenseInfo.retrieve(key); + final LicenseInfo info = LicenseInfo.retrieveNamed(key); if (info.isNone()) { drawFlash(ug, installed); return; @@ -145,7 +145,7 @@ public class PSystemKeygen extends AbstractPSystem { private void drawFlash(UGraphic ug, LicenseInfo info) throws IOException { final List strings = header(); strings.add("To get your Professional Edition License,"); - strings.add("please send this flashcode to plantuml@gmail.com :"); + strings.add("please send this qrcode to plantuml@gmail.com :"); TextBlock disp = GraphicStrings.createBlackOnWhite(strings); disp.drawU(ug); diff --git a/src/net/sourceforge/plantuml/version/PSystemVersion.java b/src/net/sourceforge/plantuml/version/PSystemVersion.java index 224e8dec2..207d10ca8 100644 --- a/src/net/sourceforge/plantuml/version/PSystemVersion.java +++ b/src/net/sourceforge/plantuml/version/PSystemVersion.java @@ -64,8 +64,8 @@ import net.sourceforge.plantuml.dedication.Dedication; import net.sourceforge.plantuml.graphic.GraphicPosition; import net.sourceforge.plantuml.graphic.GraphicStrings; import net.sourceforge.plantuml.preproc.ImportedFiles; -import net.sourceforge.plantuml.preproc.PreprocessorInclude; import net.sourceforge.plantuml.preproc.Stdlib; +import net.sourceforge.plantuml.preproc2.PreprocessorInclude3; import net.sourceforge.plantuml.svek.TextBlockBackcolored; import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; import net.sourceforge.plantuml.ugraphic.ImageBuilder; @@ -90,14 +90,22 @@ public class PSystemVersion extends AbstractPSystem { return getImage("charlie.png"); } - public static BufferedImage getTime() { - return getImage("time00.png"); + public static BufferedImage getTime01() { + return getImage("time01.png"); + } + + public static BufferedImage getTime15() { + return getImage("time15.png"); } public static BufferedImage getPlantumlSmallIcon() { return getImage("favicon.png"); } + public static BufferedImage getArecibo() { + return getImage("arecibo.png"); + } + public static BufferedImage getApple2Image() { return getImageWebp("apple2.png"); } @@ -169,7 +177,7 @@ public class PSystemVersion extends AbstractPSystem { strings.add("Word Mode"); strings.add("Command Line: " + Run.getCommandLine()); strings.add("Current Dir: " + new File(".").getAbsolutePath()); - strings.add("plantuml.include.path: " + PreprocessorInclude.getenv("plantuml.include.path")); + strings.add("plantuml.include.path: " + PreprocessorInclude3.getenv("plantuml.include.path")); } } strings.add(" "); @@ -316,6 +324,31 @@ public class PSystemVersion extends AbstractPSystem { return new PSystemVersion(false, strings); } + public static PSystemVersion createDumpStackTrace() throws IOException { + final List strings = new ArrayList(); + final Throwable creationPoint = new Throwable(); + creationPoint.fillInStackTrace(); + for (StackTraceElement ste : creationPoint.getStackTrace()) { + strings.add(ste.toString()); + } + return new PSystemVersion(false, strings); + } + + public static PSystemVersion createKeyDistributor() throws IOException { + final LicenseInfo license = LicenseInfo.retrieveDistributor(); + + final List strings = new ArrayList(); + if (license == null) { + strings.add("No license found"); + } else { + strings.add(license.getOwner()); + strings.add(license.getContext()); + strings.add(license.getGenerationDate().toString()); + strings.add(license.getExpirationDate().toString()); + } + return new PSystemVersion(false, strings); + } + public static PSystemVersion createPath() throws IOException { final List strings = new ArrayList(); strings.add("Current Dir: " + new File(".").getAbsolutePath()); diff --git a/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java b/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java index 23ea3438f..229848c36 100644 --- a/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java +++ b/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java @@ -62,14 +62,28 @@ public class PSystemVersionFactory extends PSystemSingleLineFactory { if (line.matches("(?i)^testdot\\s*$")) { return PSystemVersion.createTestDot(); } + if (line.matches("(?i)^dumpstacktrace\\s*$")) { + return PSystemVersion.createDumpStackTrace(); + } + if (line.matches("(?i)^keydistributor\\s*$")) { + return PSystemVersion.createKeyDistributor(); + } if (line.matches("(?i)^checkversion\\s*$")) { return PSystemVersion.createCheckVersions(null, null); } - if (line.matches("(?i)^keygen(\\s+[0-9a-z]+)?\\s*$")) { + if (line.matches("(?i)^(keygen|keyimport)(\\s+[0-9a-z]+)?\\s*$")) { line = line.trim(); - final String key = line.substring("keygen".length()).trim(); + final String key = line.startsWith("keygen") ? line.substring("keygen".length()).trim() : line + .substring("keyimport".length()).trim(); return new PSystemKeygen(key); } + if (line.matches("(?i)^keycheck\\s+([0-9a-z]+)\\s+([0-9a-z]+)\\s*$")) { + final Pattern p = Pattern.compile("(?i)^keycheck\\s+([0-9a-z]+)\\s+([0-9a-z]+)\\s*$"); + final Matcher m = p.matcher(line); + if (m.find()) { + return new PSystemKeycheck(m.group(1), m.group(2)); + } + } final Pattern p1 = Pattern.compile("(?i)^checkversion\\(proxy=([\\w.]+),port=(\\d+)\\)$"); final Matcher m1 = p1.matcher(line); if (m1.matches()) { diff --git a/src/net/sourceforge/plantuml/version/Version.java b/src/net/sourceforge/plantuml/version/Version.java index 91473aa34..155df2d4a 100644 --- a/src/net/sourceforge/plantuml/version/Version.java +++ b/src/net/sourceforge/plantuml/version/Version.java @@ -43,7 +43,7 @@ public class Version { private static final int MAJOR_SEPARATOR = 1000000; public static int version() { - return 1201812; + return 1201813; } public static int versionPatched() { @@ -88,7 +88,7 @@ public class Version { } public static long compileTime() { - return 1540116915987L; + return 1543252311095L; } public static String compileTimeString() { diff --git a/src/smetana/core/CFunction.java b/src/smetana/core/CFunction.java index d1aa50827..dd0680b97 100644 --- a/src/smetana/core/CFunction.java +++ b/src/smetana/core/CFunction.java @@ -36,7 +36,9 @@ package smetana.core; -import h.*; +import h.Dtcompar_f; +import h.Dtmemory_f; +import h.Dtsearch_f; public interface CFunction extends __ptr__, Dtmemory_f, Dtcompar_f, Dtsearch_f { diff --git a/src/smetana/core/CString.java b/src/smetana/core/CString.java index 5b9908d38..16197e08b 100644 --- a/src/smetana/core/CString.java +++ b/src/smetana/core/CString.java @@ -42,7 +42,6 @@ import java.util.ArrayList; import java.util.List; import smetana.core.amiga.Area; -import smetana.core.amiga.StarStruct; public class CString extends UnsupportedC implements __ptr__, Area { diff --git a/src/smetana/core/JUtils.java b/src/smetana/core/JUtils.java index b80d8ed02..682575975 100644 --- a/src/smetana/core/JUtils.java +++ b/src/smetana/core/JUtils.java @@ -37,7 +37,6 @@ package smetana.core; import h.Agcbstack_s; -import h.ST_Agdisc_s; import h.Agdstate_s; import h.Agiodisc_s; import h.GVCOMMON_t; @@ -112,7 +111,7 @@ import h.ST_textspan_t; import h.ST_tna_t; import h.ST_triangle_t; import h.ST_xlabel_t; -import h._dthold_s; +import h.ST_dthold_s; import h.layout_t; import h.rank_t; import h.tedge_t; @@ -375,47 +374,37 @@ public class JUtils { System.err.println("*********** PRINT EDGE ********** "); final ST_Agedgeinfo_t data = (ST_Agedgeinfo_t) Macro.AGDATA(e).castTo(ST_Agedgeinfo_t.class); final ST_splines splines = (ST_splines) data.spl; - ST_boxf bb = (ST_boxf) splines.getStruct("bb"); - final ST_bezier list = (ST_bezier) splines.getPtr("list"); + // ST_boxf bb = (ST_boxf) splines.bb; + final ST_bezier list = splines.list.getPtr(); System.err.println("splines.size=" + splines.size); - System.err.println("bb.LL=" + pointftoString(bb.LL)); - System.err.println("bb.UR=" + pointftoString(bb.UR)); - printDebugBezier((ST_bezier) splines.getPtr("list").getPtr()); + //System.err.println("bb.LL=" + pointftoString(bb.LL)); + //System.err.println("bb.UR=" + pointftoString(bb.UR)); + printDebugBezier((ST_bezier) splines.list.getPtr()); } private static String pointftoString(ST_pointf point) { final StringBuilder sb = new StringBuilder(); sb.append("("); - sb.append(point.getDouble("x")); + sb.append(point.x); sb.append(" ; "); - sb.append(point.getDouble("y")); + sb.append(point.y); sb.append(")"); return sb.toString(); } private static void printDebugBezier(ST_bezier bezier) { System.err.println("bezier.size=" + bezier.size); - System.err.println("bezier.sflag=" + bezier.getInt("sflag")); - System.err.println("splines.eflag=" + bezier.getInt("eflag")); + System.err.println("bezier.sflag=" + bezier.sflag); + System.err.println("splines.eflag=" + bezier.eflag); System.err.println("bezier.sp=" + pointftoString(bezier.sp)); System.err.println("bezier.ep=" + pointftoString(bezier.ep)); for (int i = 0; i < bezier.size; i++) { - final __ptr__ pt = bezier.getPtr("list").plus(i).getPtr(); + final ST_pointf pt = bezier.list.get(i); System.err.println("pt=" + pointftoString(pt)); } } - private static String pointftoString(__ptr__ point) { - final StringBuilder sb = new StringBuilder(); - sb.append("("); - sb.append(point.getDouble("x")); - sb.append(" ; "); - sb.append(point.getDouble("y")); - sb.append(")"); - return sb.toString(); - } - public static __struct__ from(Class theClass) { if (theClass == ST_dtmethod_s.class) { return new ST_dtmethod_s(); @@ -587,7 +576,7 @@ public class JUtils { if (theClass == ST_bezier.class) { return new ST_bezier(); } - if (theClass == _dthold_s.class) { + if (theClass == ST_dthold_s.class) { return new ST_dthold_s(); } // @@ -821,7 +810,7 @@ public class JUtils { if (theClass == ST_bezier.class) { return new ST_bezier(parent); } - if (theClass == _dthold_s.class) { + if (theClass == ST_dthold_s.class) { return new ST_dthold_s(parent); } // @@ -891,9 +880,6 @@ public class JUtils { if (theClass == ST_cinfo_t.class) { return new ST_cinfo_t(parent); } - if (theClass == LeafList_t.class) { - return new ST_LeafList_t(parent); - } // } notFound(theClass); throw new UnsupportedOperationException(); diff --git a/src/smetana/core/Macro.java b/src/smetana/core/Macro.java index a3d35f800..59e510752 100644 --- a/src/smetana/core/Macro.java +++ b/src/smetana/core/Macro.java @@ -209,11 +209,11 @@ public class Macro { // #define AGTAIL(e) (AGMKIN(e)->node) public static ST_Agnode_s AGTAIL(__ptr__ e) { - return (ST_Agnode_s) AGMKIN(e).getPtr("node"); + return (ST_Agnode_s) AGMKIN(e).node; } public static ST_Agnode_s agtail(__ptr__ e) { - return (ST_Agnode_s) AGMKIN(e).getPtr("node"); + return (ST_Agnode_s) AGMKIN(e).node; } public static void agtail(ST_Agedge_s e, __ptr__ v) { @@ -222,11 +222,11 @@ public class Macro { // #define AGHEAD(e) (AGMKOUT(e)->node) public static ST_Agnode_s AGHEAD(__ptr__ e) { - return (ST_Agnode_s) AGMKOUT(e).getPtr("node"); + return (ST_Agnode_s) AGMKOUT(e).node; } private static ST_Agnode_s aghead(ST_Agedge_s e) { - return (ST_Agnode_s) AGMKOUT(e).getPtr("node"); + return (ST_Agnode_s) AGMKOUT(e).node; } public static void aghead(ST_Agedge_s e, __ptr__ v) { @@ -286,11 +286,11 @@ public class Macro { // #define GD_parent(g) (((Agraphinfo_t*)AGDATA(g))->parent) public static __ptr__ GD_parent(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getPtr("parent"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).parent; } public static void GD_parent(ST_Agraph_s g, __ptr__ v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setPtr("parent", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("parent", v); } // #define GD_level(g) (((Agraphinfo_t*)AGDATA(g))->level) @@ -300,26 +300,26 @@ public class Macro { } public static void GD_drawing(ST_Agraph_s g, __ptr__ v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setPtr("drawing", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("drawing", v); } // #define GD_bb(g) (((Agraphinfo_t*)AGDATA(g))->bb) public static ST_boxf GD_bb(__ptr__ g) { - return (ST_boxf) AGDATA(g).castTo(ST_Agraphinfo_t.class).getStruct("bb"); + return (ST_boxf) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).bb; } // #define GD_gvc(g) (((Agraphinfo_t*)AGDATA(g))->gvc) public static ST_GVC_s GD_gvc(ST_Agraph_s g) { - return (ST_GVC_s) AGDATA(g).castTo(ST_Agraphinfo_t.class).getPtr("gvc"); + return (ST_GVC_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).gvc; } public static void GD_gvc(ST_Agraph_s g, ST_GVC_s v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setPtr("gvc", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("gvc", v); } // #define GD_cleanup(g) (((Agraphinfo_t*)AGDATA(g))->cleanup) public static __ptr__ GD_cleanup(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getPtr("cleanup"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).cleanup; } // #define GD_dist(g) (((Agraphinfo_t*)AGDATA(g))->dist) @@ -331,144 +331,144 @@ public class Macro { // #define GD_cl_cnt(g) (((Agraphinfo_t*)AGDATA(g))->cl_nt) // #define GD_clust(g) (((Agraphinfo_t*)AGDATA(g))->clust) - public static __ptr__ GD_clust(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getPtr("clust"); + public static ST_Agraph_s.Array GD_clust(ST_Agraph_s g) { + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).clust; } public static void GD_clust(ST_Agraph_s g, __ptr__ v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setPtr("clust", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("clust", v); } // #define GD_dotroot(g) (((Agraphinfo_t*)AGDATA(g))->dotroot) public static ST_Agraph_s GD_dotroot(ST_Agraph_s g) { - return (ST_Agraph_s) AGDATA(g).castTo(ST_Agraphinfo_t.class).getPtr("dotroot"); + return (ST_Agraph_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).dotroot; } public static void GD_dotroot(ST_Agraph_s g, __ptr__ v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setPtr("dotroot", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("dotroot", v); } // #define GD_comp(g) (((Agraphinfo_t*)AGDATA(g))->comp) public static ST_nlist_t GD_comp(ST_Agraph_s g) { - return (ST_nlist_t) AGDATA(g).castTo(ST_Agraphinfo_t.class).getStruct("comp"); + return (ST_nlist_t) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).comp; } // #define GD_exact_ranksep(g) (((Agraphinfo_t*)AGDATA(g))->exact_ranksep) public static int GD_exact_ranksep(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("exact_ranksep"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).exact_ranksep; } public static void GD_exact_ranksep(ST_Agraph_s g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("exact_ranksep", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("exact_ranksep", v); } // #define GD_expanded(g) (((Agraphinfo_t*)AGDATA(g))->expanded) public static boolean GD_expanded(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getBoolean("expanded"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).expanded; } public static void GD_expanded(ST_Agraph_s g, boolean v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setBoolean("expanded", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).expanded = v; } // #define GD_flags(g) (((Agraphinfo_t*)AGDATA(g))->flags) public static int GD_flags(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("flags"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).flags; } public static void GD_flags(ST_Agraph_s g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("flags", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("flags", v); } // #define GD_gui_state(g) (((Agraphinfo_t*)AGDATA(g))->gui_state) // #define GD_charset(g) (((Agraphinfo_t*)AGDATA(g))->charset) public static int GD_charset(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("charset"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).charset; } public static void GD_charset(ST_Agraph_s g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("charset", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("charset", v); } // #define GD_has_labels(g) (((Agraphinfo_t*)AGDATA(g))->has_labels) public static int GD_has_labels(__ptr__ g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("has_labels"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).has_labels; } public static void GD_has_labels(__ptr__ g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("has_labels", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("has_labels", v); } // #define GD_has_images(g) (((Agraphinfo_t*)AGDATA(g))->has_images) // #define GD_has_flat_edges(g) (((Agraphinfo_t*)AGDATA(g))->has_flat_edges) public static int GD_has_flat_edges(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("has_flat_edges"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).has_flat_edges; } public static void GD_has_flat_edges(ST_Agraph_s g, boolean v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setBoolean("has_flat_edges", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).has_flat_edges = v?1:0; } // #define GD_has_sourcerank(g) (((Agraphinfo_t*)AGDATA(g))->has_sourcerank) // #define GD_has_sinkrank(g) (((Agraphinfo_t*)AGDATA(g))->has_sinkrank) // #define GD_ht1(g) (((Agraphinfo_t*)AGDATA(g))->ht1) public static double GD_ht1(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getDouble("ht1"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).ht1; } public static void GD_ht1(ST_Agraph_s g, double v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setDouble("ht1", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setDouble("ht1", v); } // #define GD_ht2(g) (((Agraphinfo_t*)AGDATA(g))->ht2) public static double GD_ht2(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getDouble("ht2"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).ht2; } public static void GD_ht2(ST_Agraph_s g, double v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setDouble("ht2", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setDouble("ht2", v); } // #define GD_inleaf(g) (((Agraphinfo_t*)AGDATA(g))->inleaf) // #define GD_installed(g) (((Agraphinfo_t*)AGDATA(g))->installed) public static int GD_installed(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("installed"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).installed; } public static void GD_installed(ST_Agraph_s g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("installed", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("installed", v); } // #define GD_label(g) (((Agraphinfo_t*)AGDATA(g))->label) public static ST_textlabel_t GD_label(__ptr__ g) { - return (ST_textlabel_t) AGDATA(g).castTo(ST_Agraphinfo_t.class).getPtr("label"); + return (ST_textlabel_t) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).label; } public static void GD_label(__ptr__ g, __ptr__ v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setPtr("label", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("label", v); } // #define GD_leader(g) (((Agraphinfo_t*)AGDATA(g))->leader) public static ST_Agnode_s GD_leader(ST_Agraph_s g) { - return (ST_Agnode_s) AGDATA(g).castTo(ST_Agraphinfo_t.class).getPtr("leader"); + return (ST_Agnode_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).leader; } public static void GD_leader(ST_Agraph_s g, __ptr__ v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setPtr("leader", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("leader", v); } // #define GD_rankdir2(g) (((Agraphinfo_t*)AGDATA(g))->rankdir) public static int GD_rankdir2(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("rankdir"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).rankdir; } public static void GD_rankdir2(ST_Agraph_s g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("rankdir", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("rankdir", v); } // #define GD_rankdir(g) (((Agraphinfo_t*)AGDATA(g))->rankdir & 0x3) public static int GD_rankdir(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("rankdir") & 0x3; + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).rankdir & 0x3; } // #define GD_flip(g) (GD_rankdir(g) & 1) @@ -480,39 +480,39 @@ public class Macro { // #define GD_realflip(g) (GD_realrankdir(g) & 1) // #define GD_ln(g) (((Agraphinfo_t*)AGDATA(g))->ln) public static ST_Agnode_s GD_ln(ST_Agraph_s g) { - return (ST_Agnode_s) AGDATA(g).castTo(ST_Agraphinfo_t.class).getPtr("ln"); + return (ST_Agnode_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).ln; } public static void GD_ln(ST_Agraph_s g, __ptr__ v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setPtr("ln", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("ln", v); } // #define GD_maxrank(g) (((Agraphinfo_t*)AGDATA(g))->maxrank) public static int GD_maxrank(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("maxrank"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).maxrank; } public static void GD_maxrank(ST_Agraph_s g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("maxrank", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("maxrank", v); } // #define GD_maxset(g) (((Agraphinfo_t*)AGDATA(g))->maxset) public static __ptr__ GD_maxset(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getPtr("maxset"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).maxset; } // #define GD_minrank(g) (((Agraphinfo_t*)AGDATA(g))->minrank) public static int GD_minrank(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("minrank"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).minrank; } public static void GD_minrank(ST_Agraph_s g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("minrank", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("minrank", v); } // #define GD_minset(g) (((Agraphinfo_t*)AGDATA(g))->minset) public static __ptr__ GD_minset(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getPtr("minset"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).minset; } // #define GD_minrep(g) (((Agraphinfo_t*)AGDATA(g))->minrep) @@ -520,20 +520,20 @@ public class Macro { // #define GD_move(g) (((Agraphinfo_t*)AGDATA(g))->move) // #define GD_n_cluster(g) (((Agraphinfo_t*)AGDATA(g))->n_cluster) public static int GD_n_cluster(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("n_cluster"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).n_cluster; } public static void GD_n_cluster(ST_Agraph_s g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("n_cluster", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("n_cluster", v); } // #define GD_n_nodes(g) (((Agraphinfo_t*)AGDATA(g))->n_nodes) public static int GD_n_nodes(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("n_nodes"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).n_nodes; } public static void GD_n_nodes(ST_Agraph_s g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("n_nodes", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("n_nodes", v); } // #define GD_ndim(g) (((Agraphinfo_t*)AGDATA(g))->ndim) @@ -541,93 +541,93 @@ public class Macro { // #define GD_neato_nlist(g) (((Agraphinfo_t*)AGDATA(g))->neato_nlist) // #define GD_nlist(g) (((Agraphinfo_t*)AGDATA(g))->nlist) public static ST_Agnode_s GD_nlist(ST_Agraph_s g) { - return (ST_Agnode_s) AGDATA(g).castTo(ST_Agraphinfo_t.class).getPtr("nlist"); + return (ST_Agnode_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).nlist; } public static void GD_nlist(ST_Agraph_s g, __ptr__ v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setPtr("nlist", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("nlist", v); } // #define GD_nodesep(g) (((Agraphinfo_t*)AGDATA(g))->nodesep) public static int GD_nodesep(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("nodesep"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).nodesep; } public static void GD_nodesep(ST_Agraph_s g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("nodesep", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("nodesep", v); } // #define GD_outleaf(g) (((Agraphinfo_t*)AGDATA(g))->outleaf) // #define GD_rank(g) (((Agraphinfo_t*)AGDATA(g))->rank) public static ST_rank_t.Array2 GD_rank(ST_Agraph_s g) { - return (ST_rank_t.Array2) AGDATA(g).castTo(ST_Agraphinfo_t.class).getPtr("rank"); + return (ST_rank_t.Array2) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).rank; } public static void GD_rank(ST_Agraph_s g, ST_rank_t.Array2 v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setPtr("rank", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("rank", v); } // #define GD_rankleader(g) (((Agraphinfo_t*)AGDATA(g))->rankleader) - public static __ptr__ GD_rankleader(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getPtr("rankleader"); + public static ST_Agnode_s.Array GD_rankleader(ST_Agraph_s g) { + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).rankleader; } public static void GD_rankleader(ST_Agraph_s g, __ptr__ v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setPtr("rankleader", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("rankleader", v); } // #define GD_ranksep(g) (((Agraphinfo_t*)AGDATA(g))->ranksep) public static int GD_ranksep(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("ranksep"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).ranksep; } public static void GD_ranksep(ST_Agraph_s g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("ranksep", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("ranksep", v); } // #define GD_rn(g) (((Agraphinfo_t*)AGDATA(g))->rn) public static ST_Agnode_s GD_rn(ST_Agraph_s g) { - return (ST_Agnode_s) AGDATA(g).castTo(ST_Agraphinfo_t.class).getPtr("rn"); + return (ST_Agnode_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).rn; } public static void GD_rn(ST_Agraph_s g, __ptr__ v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setPtr("rn", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("rn", v); } // #define GD_set_type(g) (((Agraphinfo_t*)AGDATA(g))->set_type) public static int GD_set_type(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("set_type"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).set_type; } public static void GD_set_type(ST_Agraph_s g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("set_type", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("set_type", v); } // #define GD_label_pos(g) (((Agraphinfo_t*)AGDATA(g))->label_pos) public static int GD_label_pos(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("label_pos"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).label_pos; } public static void GD_label_pos(ST_Agraph_s g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("label_pos", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("label_pos", v); } // #define GD_showboxes(g) (((Agraphinfo_t*)AGDATA(g))->showboxes) public static int GD_showboxes(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("showboxes"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).showboxes; } public static void GD_showboxes(ST_Agraph_s g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("showboxes", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("showboxes", v); } // #define GD_fontnames(g) (((Agraphinfo_t*)AGDATA(g))->fontnames) public static int GD_fontnames(ST_Agraph_s g) { - return AGDATA(g).castTo(ST_Agraphinfo_t.class).getInt("fontnames"); + return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).fontnames; } public static void GD_fontnames(ST_Agraph_s g, int v) { - AGDATA(g).castTo(ST_Agraphinfo_t.class).setInt("fontnames", v); + ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("fontnames", v); } // #define GD_spring(g) (((Agraphinfo_t*)AGDATA(g))->spring) @@ -636,89 +636,89 @@ public class Macro { // #define ND_id(n) (((Agnodeinfo_t*)AGDATA(n))->id) public static int ND_id(ST_Agnode_s n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getInt("id"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).id; } // #define ND_alg(n) (((Agnodeinfo_t*)AGDATA(n))->alg) public static __ptr__ ND_alg(ST_Agnode_s n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getPtr("alg"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).alg; } public static void ND_alg(ST_Agnode_s n, __ptr__ value) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setPtr("alg", value); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("alg", value); } // #define ND_UF_parent(n) (((Agnodeinfo_t*)AGDATA(n))->UF_parent) public static ST_Agnode_s ND_UF_parent(__ptr__ n) { - return (ST_Agnode_s) AGDATA(n).castTo(ST_Agnodeinfo_t.class).getPtr("UF_parent"); + return (ST_Agnode_s) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).UF_parent; } public static void ND_UF_parent(__ptr__ n, __ptr__ v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setPtr("UF_parent", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("UF_parent", v); } // #define ND_set(n) (((Agnodeinfo_t*)AGDATA(n))->set) // #define ND_UF_size(n) (((Agnodeinfo_t*)AGDATA(n))->UF_size) public static int ND_UF_size(ST_Agnode_s n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getInt("UF_size"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).UF_size; } public static void ND_UF_size(ST_Agnode_s n, int v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setInt("UF_size", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("UF_size", v); } // #define ND_bb(n) (((Agnodeinfo_t*)AGDATA(n))->bb) // #define ND_clust(n) (((Agnodeinfo_t*)AGDATA(n))->clust) public static ST_Agraph_s ND_clust(__ptr__ n) { - return (ST_Agraph_s) AGDATA(n).castTo(ST_Agnodeinfo_t.class).getPtr("clust"); + return (ST_Agraph_s) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).clust; } public static void ND_clust(ST_Agnode_s n, __ptr__ v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setPtr("clust", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("clust", v); } // #define ND_coord(n) (((Agnodeinfo_t*)AGDATA(n))->coord) public static ST_pointf ND_coord(__ptr__ n) { - return (ST_pointf) AGDATA(n).castTo(ST_Agnodeinfo_t.class).getStruct("coord"); + return (ST_pointf) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).coord; } // #define ND_dist(n) (((Agnodeinfo_t*)AGDATA(n))->dist) // #define ND_flat_in(n) (((Agnodeinfo_t*)AGDATA(n))->flat_in) public static ST_elist ND_flat_in(ST_Agnode_s n) { - return (ST_elist) AGDATA(n).castTo(ST_Agnodeinfo_t.class).getStruct("flat_in"); + return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).flat_in; } // #define ND_flat_out(n) (((Agnodeinfo_t*)AGDATA(n))->flat_out) public static ST_elist ND_flat_out(ST_Agnode_s n) { - return (ST_elist) AGDATA(n).castTo(ST_Agnodeinfo_t.class).getStruct("flat_out"); + return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).flat_out; } // #define ND_gui_state(n) (((Agnodeinfo_t*)AGDATA(n))->gui_state) // #define ND_has_port(n) (((Agnodeinfo_t*)AGDATA(n))->has_port) public static boolean ND_has_port(ST_Agnode_s n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getBoolean("has_port"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).has_port; } // #define ND_rep(n) (((Agnodeinfo_t*)AGDATA(n))->rep) // #define ND_heapindex(n) (((Agnodeinfo_t*)AGDATA(n))->heapindex) // #define ND_height(n) (((Agnodeinfo_t*)AGDATA(n))->height) public static double ND_height(__ptr__ n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getDouble("height"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).height; } public static void ND_height(ST_Agnode_s n, double v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setDouble("height", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("height", v); } // #define ND_hops(n) (((Agnodeinfo_t*)AGDATA(n))->hops) // #define ND_ht(n) (((Agnodeinfo_t*)AGDATA(n))->ht) public static double ND_ht(__ptr__ n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getDouble("ht"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).ht; } public static void ND_ht(ST_Agnode_s n, double v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setDouble("ht", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("ht", v); } // #define ND_in(n) (((Agnodeinfo_t*)AGDATA(n))->in) @@ -727,75 +727,75 @@ public class Macro { } public static void ND_in(__ptr__ n, __struct__ v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setStruct("in", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setStruct("in", v); } // #define ND_inleaf(n) (((Agnodeinfo_t*)AGDATA(n))->inleaf) public static __ptr__ ND_inleaf(ST_Agnode_s n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getPtr("inleaf"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).inleaf; } // #define ND_label(n) (((Agnodeinfo_t*)AGDATA(n))->label) public static ST_textlabel_t ND_label(ST_Agnode_s n) { - return (ST_textlabel_t) AGDATA(n).castTo(ST_Agnodeinfo_t.class).getPtr("label"); + return (ST_textlabel_t) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).label; } public static void ND_label(ST_Agnode_s n, __ptr__ v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setPtr("label", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("label", v); } // #define ND_xlabel(n) (((Agnodeinfo_t*)AGDATA(n))->xlabel) public static ST_textlabel_t ND_xlabel(ST_Agnode_s n) { - return (ST_textlabel_t) AGDATA(n).castTo(ST_Agnodeinfo_t.class).getPtr("xlabel"); + return (ST_textlabel_t) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).xlabel; } // #define ND_lim(n) (((Agnodeinfo_t*)AGDATA(n))->lim) public static int ND_lim(ST_Agnode_s n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getInt("lim"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).lim; } public static void ND_lim(ST_Agnode_s n, int v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setInt("lim", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("lim", v); } // #define ND_low(n) (((Agnodeinfo_t*)AGDATA(n))->low) public static int ND_low(ST_Agnode_s n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getInt("low"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).low; } public static void ND_low(ST_Agnode_s n, int v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setInt("low", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("low", v); } // #define ND_lw(n) (((Agnodeinfo_t*)AGDATA(n))->lw) public static double ND_lw(__ptr__ n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getDouble("lw"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).lw; } public static void ND_lw(ST_Agnode_s n, double v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setDouble("lw", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("lw", v); } // #define ND_mark(n) (((Agnodeinfo_t*)AGDATA(n))->mark) public static int ND_mark(__ptr__ n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getInt("mark"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).mark; } public static void ND_mark(__ptr__ n, int v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setInt("mark", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("mark", v); } public static void ND_mark(__ptr__ n, boolean v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setBoolean("mark", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).mark = v?1:0; } // #define ND_mval(n) (((Agnodeinfo_t*)AGDATA(n))->mval) public static double ND_mval(__ptr__ n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getDouble("mval"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).mval; } public static void ND_mval(ST_Agnode_s n, double v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setDouble("mval", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("mval", v); } // #define ND_n_cluster(n) (((Agnodeinfo_t*)AGDATA(n))->n_cluster) @@ -805,43 +805,43 @@ public class Macro { } public static void ND_next(__ptr__ n, __ptr__ v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setPtr("next", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("next", v); } // #define ND_node_type(n) (((Agnodeinfo_t*)AGDATA(n))->node_type) public static int ND_node_type(ST_Agnode_s n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getInt("node_type"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).node_type; } public static void ND_node_type(ST_Agnode_s n, int v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setInt("node_type", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("node_type", v); } // #define ND_onstack(n) (((Agnodeinfo_t*)AGDATA(n))->onstack) public static boolean ND_onstack(ST_Agnode_s n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getBoolean("onstack"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).onstack!=0; } public static void ND_onstack(ST_Agnode_s n, int v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setInt("onstack", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("onstack", v); } public static void ND_onstack(ST_Agnode_s n, boolean v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setBoolean("onstack", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).onstack = v?1:0; } // #define ND_order(n) (((Agnodeinfo_t*)AGDATA(n))->order) public static int ND_order(__ptr__ n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getInt("order"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).order; } public static void ND_order(__ptr__ n, int v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setInt("order", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("order", v); } // #define ND_other(n) (((Agnodeinfo_t*)AGDATA(n))->other) public static ST_elist ND_other(ST_Agnode_s n) { - return (ST_elist) AGDATA(n).castTo(ST_Agnodeinfo_t.class).getStruct("other"); + return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).other; } // #define ND_out(n) (((Agnodeinfo_t*)AGDATA(n))->out) @@ -850,86 +850,86 @@ public class Macro { } public static void ND_out(__ptr__ n, __struct__ v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setStruct("out", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setStruct("out", v); } // #define ND_outleaf(n) (((Agnodeinfo_t*)AGDATA(n))->outleaf) public static __ptr__ ND_outleaf(ST_Agnode_s n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getPtr("outleaf"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).outleaf; } // #define ND_par(n) (((Agnodeinfo_t*)AGDATA(n))->par) public static ST_Agedge_s ND_par(ST_Agnode_s n) { - return (ST_Agedge_s) AGDATA(n).castTo(ST_Agnodeinfo_t.class).getPtr("par"); + return (ST_Agedge_s) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).par; } public static void ND_par(ST_Agnode_s n, __ptr__ v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setPtr("par", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("par", v); } // #define ND_pinned(n) (((Agnodeinfo_t*)AGDATA(n))->pinned) // #define ND_pos(n) (((Agnodeinfo_t*)AGDATA(n))->pos) // #define ND_prev(n) (((Agnodeinfo_t*)AGDATA(n))->prev) public static __ptr__ ND_prev(ST_Agnode_s n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getPtr("prev"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).prev; } public static void ND_prev(ST_Agnode_s n, __ptr__ v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setPtr("prev", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("prev", v); } // #define ND_priority(n) (((Agnodeinfo_t*)AGDATA(n))->priority) public static int ND_priority(ST_Agnode_s n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getInt("priority"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).priority; } public static void ND_priority(ST_Agnode_s n, int v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setInt("priority", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("priority", v); } // #define ND_rank(n) (((Agnodeinfo_t*)AGDATA(n))->rank) public static int ND_rank(__ptr__ n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getInt("rank"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).rank; } public static void ND_rank(__ptr__ n, int v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setInt("rank", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("rank", v); } // #define ND_ranktype(n) (((Agnodeinfo_t*)AGDATA(n))->ranktype) public static int ND_ranktype(ST_Agnode_s n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getInt("ranktype"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).ranktype; } public static void ND_ranktype(ST_Agnode_s n, int v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setInt("ranktype", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("ranktype", v); } // #define ND_rw(n) (((Agnodeinfo_t*)AGDATA(n))->rw) public static double ND_rw(__ptr__ n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getDouble("rw"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).rw; } public static void ND_rw(ST_Agnode_s n, double v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setDouble("rw", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("rw", v); } // #define ND_save_in(n) (((Agnodeinfo_t*)AGDATA(n))->save_in) public static ST_elist ND_save_in(ST_Agnode_s n) { - return (ST_elist) AGDATA(n).castTo(ST_Agnodeinfo_t.class).getStruct("save_in"); + return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).save_in; } public static void ND_save_in(ST_Agnode_s n, __struct__ v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setStruct("save_in", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setStruct("save_in", v); } // #define ND_save_out(n) (((Agnodeinfo_t*)AGDATA(n))->save_out) public static ST_elist ND_save_out(ST_Agnode_s n) { - return (ST_elist) AGDATA(n).castTo(ST_Agnodeinfo_t.class).getStruct("save_out"); + return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).save_out; } public static void ND_save_out(ST_Agnode_s n, __struct__ v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setStruct("save_out", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setStruct("save_out", v); } // #define ND_shape(n) (((Agnodeinfo_t*)AGDATA(n))->shape) @@ -938,51 +938,51 @@ public class Macro { } public static void ND_shape(ST_Agnode_s n, __ptr__ v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setPtr("shape", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("shape", v); } // #define ND_shape_info(n) (((Agnodeinfo_t*)AGDATA(n))->shape_info) public static __ptr__ ND_shape_info(__ptr__ n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getPtr("shape_info"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).shape_info; } // #define ND_showboxes(n) (((Agnodeinfo_t*)AGDATA(n))->showboxes) public static int ND_showboxes(ST_Agnode_s n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getInt("showboxes"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).showboxes; } public static void ND_showboxes(ST_Agnode_s n, int v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setInt("showboxes", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("showboxes", v); } // #define ND_state(n) (((Agnodeinfo_t*)AGDATA(n))->state) // #define ND_clustnode(n) (((Agnodeinfo_t*)AGDATA(n))->clustnode) // #define ND_tree_in(n) (((Agnodeinfo_t*)AGDATA(n))->tree_in) public static ST_elist ND_tree_in(ST_Agnode_s n) { - return (ST_elist) AGDATA(n).castTo(ST_Agnodeinfo_t.class).getStruct("tree_in"); + return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).tree_in; } // #define ND_tree_out(n) (((Agnodeinfo_t*)AGDATA(n))->tree_out) public static ST_elist ND_tree_out(ST_Agnode_s n) { - return (ST_elist) AGDATA(n).castTo(ST_Agnodeinfo_t.class).getStruct("tree_out"); + return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).tree_out; } // #define ND_weight_class(n) (((Agnodeinfo_t*)AGDATA(n))->weight_class) public static int ND_weight_class(ST_Agnode_s n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getInt("weight_class"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).weight_class; } public static void ND_weight_class(ST_Agnode_s n, int v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setInt("weight_class", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("weight_class", v); } // #define ND_width(n) (((Agnodeinfo_t*)AGDATA(n))->width) public static double ND_width(__ptr__ n) { - return AGDATA(n).castTo(ST_Agnodeinfo_t.class).getDouble("width"); + return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).width; } public static void ND_width(ST_Agnode_s n, double v) { - AGDATA(n).castTo(ST_Agnodeinfo_t.class).setDouble("width", v); + ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("width", v); } // #define ND_xsize(n) (ND_lw(n)+ND_rw(n)) @@ -991,11 +991,11 @@ public class Macro { // #define ED_alg(e) (((Agedgeinfo_t*)AGDATA(e))->alg) // #define ED_conc_opp_flag(e) (((Agedgeinfo_t*)AGDATA(e))->conc_opp_flag) public static boolean ED_conc_opp_flag(ST_Agedge_s e) { - return AGDATA(e).castTo(ST_Agedgeinfo_t.class).getBoolean("conc_opp_flag"); + return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).conc_opp_flag; } public static void ED_conc_opp_flag(ST_Agedge_s e, boolean v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setInt("conc_opp_flag", v ? 1 : 0); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("conc_opp_flag", v ? 1 : 0); } // #define ED_count(e) (((Agedgeinfo_t*)AGDATA(e))->count) @@ -1004,88 +1004,88 @@ public class Macro { } public static void ED_count(__ptr__ e, int v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setInt("count", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("count", v); } // #define ED_cutvalue(e) (((Agedgeinfo_t*)AGDATA(e))->cutvalue) public static int ED_cutvalue(ST_Agedge_s e) { - return AGDATA(e).castTo(ST_Agedgeinfo_t.class).getInt("cutvalue"); + return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).cutvalue; } public static void ED_cutvalue(ST_Agedge_s e, int v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setInt("cutvalue", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("cutvalue", v); } // #define ED_edge_type(e) (((Agedgeinfo_t*)AGDATA(e))->edge_type) // #define ED_adjacent(e) (((Agedgeinfo_t*)AGDATA(e))->adjacent) public static int ED_adjacent(__ptr__ e) { - return AGDATA(e).castTo(ST_Agedgeinfo_t.class).getInt("adjacent"); + return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).adjacent; } public static void ED_adjacent(ST_Agedge_s e, int v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setInt("adjacent", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("adjacent", v); } // #define ED_factor(e) (((Agedgeinfo_t*)AGDATA(e))->factor) // #define ED_gui_state(e) (((Agedgeinfo_t*)AGDATA(e))->gui_state) // #define ED_head_label(e) (((Agedgeinfo_t*)AGDATA(e))->head_label) public static ST_textlabel_t ED_head_label(ST_Agedge_s e) { - return (ST_textlabel_t) AGDATA(e).castTo(ST_Agedgeinfo_t.class).getPtr("head_label"); + return (ST_textlabel_t) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).head_label; } public static void ED_head_label(ST_Agedge_s e, __ptr__ v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setPtr("head_label", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setPtr("head_label", v); } // #define ED_head_port(e) (((Agedgeinfo_t*)AGDATA(e))->head_port) public static ST_port ED_head_port(__ptr__ e) { - return (ST_port) AGDATA(e).castTo(ST_Agedgeinfo_t.class).getStruct("head_port"); + return (ST_port) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).head_port; } public static void ED_head_port(ST_Agedge_s e, ST_port v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setStruct("head_port", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setStruct("head_port", v); } // #define ED_label(e) (((Agedgeinfo_t*)AGDATA(e))->label) public static ST_textlabel_t ED_label(__ptr__ e) { - return (ST_textlabel_t) AGDATA(e).castTo(ST_Agedgeinfo_t.class).getPtr("label"); + return (ST_textlabel_t) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).label; } public static void ED_label(ST_Agedge_s e, __ptr__ v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setPtr("label", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setPtr("label", v); } // #define ED_xlabel(e) (((Agedgeinfo_t*)AGDATA(e))->xlabel) public static ST_textlabel_t ED_xlabel(ST_Agedge_s e) { - return (ST_textlabel_t) AGDATA(e).castTo(ST_Agedgeinfo_t.class).getPtr("xlabel"); + return (ST_textlabel_t) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).xlabel; } // #define ED_label_ontop(e) (((Agedgeinfo_t*)AGDATA(e))->label_ontop) public static boolean ED_label_ontop(ST_Agedge_s e) { - return AGDATA(e).castTo(ST_Agedgeinfo_t.class).getBoolean("label_ontop"); + return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).label_ontop; } public static void ED_label_ontop(ST_Agedge_s e, boolean v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setBoolean("label_ontop", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).label_ontop = v; } // #define ED_minlen(e) (((Agedgeinfo_t*)AGDATA(e))->minlen) public static int ED_minlen(ST_Agedge_s e) { - return AGDATA(e).castTo(ST_Agedgeinfo_t.class).getInt("minlen"); + return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).minlen; } public static void ED_minlen(ST_Agedge_s e, int v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setInt("minlen", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("minlen", v); } // #define ED_path(e) (((Agedgeinfo_t*)AGDATA(e))->path) // #define ED_showboxes(e) (((Agedgeinfo_t*)AGDATA(e))->showboxes) public static int ED_showboxes(ST_Agedge_s e) { - return AGDATA(e).castTo(ST_Agedgeinfo_t.class).getInt("showboxes"); + return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).showboxes; } public static void ED_showboxes(ST_Agedge_s e, int v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setInt("showboxes", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("showboxes", v); } // #define ED_spl(e) (((Agedgeinfo_t*)AGDATA(e))->spl) @@ -1099,74 +1099,74 @@ public class Macro { // #define ED_tail_label(e) (((Agedgeinfo_t*)AGDATA(e))->tail_label) public static ST_textlabel_t ED_tail_label(ST_Agedge_s e) { - return (ST_textlabel_t) AGDATA(e).castTo(ST_Agedgeinfo_t.class).getPtr("tail_label"); + return (ST_textlabel_t) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).tail_label; } public static void ED_tail_label(ST_Agedge_s e, __ptr__ v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setPtr("tail_label", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setPtr("tail_label", v); } // #define ED_tail_port(e) (((Agedgeinfo_t*)AGDATA(e))->tail_port) public static ST_port ED_tail_port(__ptr__ e) { - return (ST_port) AGDATA(e).castTo(ST_Agedgeinfo_t.class).getStruct("tail_port"); + return (ST_port) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).tail_port; } public static void ED_tail_port(ST_Agedge_s e, ST_port v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setStruct("tail_port", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setStruct("tail_port", v); } // #define ED_to_orig(e) (((Agedgeinfo_t*)AGDATA(e))->to_orig) public static ST_Agedge_s ED_to_orig(__ptr__ e) { - return (ST_Agedge_s) AGDATA(e).castTo(ST_Agedgeinfo_t.class).getPtr("to_orig"); + return (ST_Agedge_s) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).to_orig; } public static void ED_to_orig(ST_Agedge_s e, __ptr__ v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setPtr("to_orig", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setPtr("to_orig", v); } // #define ED_to_virt(e) (((Agedgeinfo_t*)AGDATA(e))->to_virt) public static ST_Agedge_s ED_to_virt(ST_Agedge_s e) { - return (ST_Agedge_s) AGDATA(e).castTo(ST_Agedgeinfo_t.class).getPtr("to_virt"); + return (ST_Agedge_s) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).to_virt; } public static void ED_to_virt(ST_Agedge_s e, __ptr__ v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setPtr("to_virt", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setPtr("to_virt", v); } // #define ED_tree_index(e) (((Agedgeinfo_t*)AGDATA(e))->tree_index) public static int ED_tree_index(__ptr__ e) { - return AGDATA(e).castTo(ST_Agedgeinfo_t.class).getInt("tree_index"); + return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).tree_index; } public static void ED_tree_index(__ptr__ e, int v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setInt("tree_index", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("tree_index", v); } // #define ED_xpenalty(e) (((Agedgeinfo_t*)AGDATA(e))->xpenalty) public static int ED_xpenalty(__ptr__ e) { - return AGDATA(e).castTo(ST_Agedgeinfo_t.class).getInt("xpenalty"); + return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).xpenalty; } public static void ED_xpenalty(ST_Agedge_s e, int v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setInt("xpenalty", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("xpenalty", v); } // #define ED_dist(e) (((Agedgeinfo_t*)AGDATA(e))->dist) public static double ED_dist(ST_Agedge_s e) { - return AGDATA(e).castTo(ST_Agedgeinfo_t.class).getDouble("dist"); + return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).dist; } public static void ED_dist(ST_Agedge_s e, double v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setDouble("dist", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setDouble("dist", v); } // #define ED_weight(e) (((Agedgeinfo_t*)AGDATA(e))->weight) public static int ED_weight(ST_Agedge_s e) { - return AGDATA(e).castTo(ST_Agedgeinfo_t.class).getInt("weight"); + return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).weight; } public static void ED_weight(ST_Agedge_s e, int v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setInt("weight", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("weight", v); } // @@ -1176,11 +1176,11 @@ public class Macro { // #define ED_cutvalue(e) (((Agedgeinfo_t*)AGDATA(e))->cutvalue) // #define ED_edge_type(e) (((Agedgeinfo_t*)AGDATA(e))->edge_type) public static int ED_edge_type(ST_Agedge_s e) { - return AGDATA(e).castTo(ST_Agedgeinfo_t.class).getInt("edge_type"); + return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).edge_type; } public static void ED_edge_type(ST_Agedge_s e, int v) { - AGDATA(e).castTo(ST_Agedgeinfo_t.class).setInt("edge_type", v); + ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("edge_type", v); } // #define ED_adjacent(e) (((Agedgeinfo_t*)AGDATA(e))->adjacent) @@ -1332,13 +1332,13 @@ public class Macro { // ED_edge_type(newp) = VIRTUAL; \ // ED_to_orig(newp) = old; \ - public static void MAKEFWDEDGE(__ptr__ new_, __ptr__ old) { + public static void MAKEFWDEDGE(ST_Agedge_s new_, ST_Agedge_s old) { ST_Agedge_s newp; ST_Agedgeinfo_t info; newp = (ST_Agedge_s) new_.getPtr(); info = (ST_Agedgeinfo_t) newp.base.data.castTo(ST_Agedgeinfo_t.class); - info.copyDataFrom(old.getStruct("base").getPtr("data").castTo(ST_Agedgeinfo_t.class).getStruct()); - newp.copyDataFrom(old); + info.copyDataFrom(old.base.data.castTo(ST_Agedgeinfo_t.class).getStruct()); + newp.copyDataFrom((__ptr__)old); newp.base.setPtr("data", info); agtail(newp, AGHEAD(old)); aghead(newp, AGTAIL(old)); @@ -1400,7 +1400,7 @@ public class Macro { public static double MICROPOINT = .000001; // #define APPROXEQPT(p,q,tol) (DIST2((p),(q)) < SQR(tol)) - public static boolean APPROXEQPT(__ptr__ p, __ptr__ q, double tol) { + public static boolean APPROXEQPT(ST_pointf p, ST_pointf q, double tol) { return (DIST2((p), (q)) < SQR(tol)); } @@ -1416,16 +1416,15 @@ public class Macro { // // #define DIST2(p,q) (LEN2(((p).x - (q).x),((p).y - (q).y))) - public static double DIST2(__ptr__ p, __ptr__ q) { - return (LEN2(((p).getDouble("x") - (q).getDouble("x")), ((p).getDouble("y") - (q).getDouble("y")))); + public static double DIST2(ST_pointf p, ST_pointf q) { + return (LEN2(((p).x - (q).x), ((p).y - (q).y))); } // #define DIST(p,q) (sqrt(DIST2((p),(q)))) // #define INSIDE(p,b) (BETWEEN((b).LL.x,(p).x,(b).UR.x) && BETWEEN((b).LL.y,(p).y,(b).UR.y)) - public static boolean INSIDE(__struct__ b, __struct__ p) { - return (BETWEEN(b.getStruct("LL").getDouble("x"), p.getDouble("x"), b.getStruct("UR").getDouble("x")) && BETWEEN( - b.getStruct("LL").getDouble("y"), p.getDouble("y"), b.getStruct("UR").getDouble("y"))); + public static boolean INSIDE(ST_pointf p, ST_boxf b) { + return (BETWEEN(b.LL.x, p.x, b.UR.x) && BETWEEN(b.LL.y, p.y, b.UR.y)); } public static final double M_PI = Math.PI; @@ -1441,9 +1440,9 @@ public class Macro { // (((a).x - (b).x) * ((a).x - (b).x)) + (((a).y - (b).y) * ((a).y - (b).y)) \ // ) - public static double DISTSQ(__struct__ a, __struct__ b) { - return (((a).getDouble("x") - (b).getDouble("x")) * ((a).getDouble("x") - (b).getDouble("x"))) - + (((a).getDouble("y") - (b).getDouble("y")) * ((a).getDouble("y") - (b).getDouble("y"))); + public static double DISTSQ(ST_pointf a, ST_pointf b) { + return (((a).x - (b).x) * ((a).x - (b).x)) + + (((a).y - (b).y) * ((a).y - (b).y)); } public static void hackInitDimensionFromLabel(ST_pointf size, String label) { diff --git a/src/smetana/core/UnsupportedArrayOfPtr.java b/src/smetana/core/UnsupportedArrayOfPtr.java index 6b26d8b36..8d95b3436 100644 --- a/src/smetana/core/UnsupportedArrayOfPtr.java +++ b/src/smetana/core/UnsupportedArrayOfPtr.java @@ -105,38 +105,10 @@ public class UnsupportedArrayOfPtr implements __array_of_ptr__ { throw new UnsupportedOperationException(getClass().toString()); } - public void setBoolean(String fieldName, boolean data) { - throw new UnsupportedOperationException(getClass().toString()); - } - public void setDouble(String fieldName, double data) { throw new UnsupportedOperationException(getClass().toString()); } - public int getInt(String fieldName) { - throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); - } - - public double getDouble(String fieldName) { - throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); - } - - public boolean getBoolean(String fieldName) { - throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); - } - - public CString getCString(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - - public __struct__ getStruct(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - - public __ptr__ getPtr(String fieldName) { - throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); - } - public void setStruct(String fieldName, __struct__ newData) { throw new UnsupportedOperationException(getClass().toString()); } @@ -161,10 +133,6 @@ public class UnsupportedArrayOfPtr implements __array_of_ptr__ { throw new UnsupportedOperationException(getClass().toString()); } - public Object call(String fieldName, Object... args) { - throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); - } - public __ptr__ castTo(Class dest) { throw new UnsupportedOperationException(getClass().toString()); } @@ -205,14 +173,6 @@ public class UnsupportedArrayOfPtr implements __array_of_ptr__ { throw new UnsupportedOperationException(getClass().toString()); } - public CString getCString() { - throw new UnsupportedOperationException(getClass().toString()); - } - - public void setCString(CString value) { - throw new UnsupportedOperationException(getClass().toString()); - } - public __array_of_ptr__ plus(int delta) { throw new UnsupportedOperationException(getClass().toString()); } diff --git a/src/smetana/core/UnsupportedArrayOfStruct2.java b/src/smetana/core/UnsupportedArrayOfStruct2.java index 32ab5171a..8cf8636ad 100644 --- a/src/smetana/core/UnsupportedArrayOfStruct2.java +++ b/src/smetana/core/UnsupportedArrayOfStruct2.java @@ -80,18 +80,10 @@ public abstract class UnsupportedArrayOfStruct2 { throw new UnsupportedOperationException(getClass().toString()); } - public double getDouble(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - public void setDouble(String fieldName, double value) { throw new UnsupportedOperationException(getClass().toString()); } - public __struct__ getStruct(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - public int getInt() { throw new UnsupportedOperationException(getClass().toString()); } @@ -117,22 +109,6 @@ public abstract class UnsupportedArrayOfStruct2 { throw new UnsupportedOperationException(getClass().toString()); } - public __ptr__ getPtr(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - - public boolean getBoolean(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - - public CString getCString(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - - public int getInt(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - public __ptr__ setPtr(String fieldName, __ptr__ data) { throw new UnsupportedOperationException(getClass().toString()); } @@ -145,18 +121,10 @@ public abstract class UnsupportedArrayOfStruct2 { throw new UnsupportedOperationException(getClass().toString()); } - public void setBoolean(String fieldName, boolean data) { - throw new UnsupportedOperationException(getClass().toString()); - } - public __ptr__ castTo(Class dest) { throw new UnsupportedOperationException(getClass().toString()); } - public Object call(String name, Object... args) { - throw new UnsupportedOperationException(getClass().toString()); - } - public Object addVirtualBytes(int bytes) { throw new UnsupportedOperationException(getClass().toString()); } diff --git a/src/smetana/core/UnsupportedC.java b/src/smetana/core/UnsupportedC.java index aa741018f..68e293c8f 100644 --- a/src/smetana/core/UnsupportedC.java +++ b/src/smetana/core/UnsupportedC.java @@ -67,10 +67,6 @@ public class UnsupportedC implements __ptr__ { throw new UnsupportedOperationException(getClass().toString()); } - public __ptr__ getPtr(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - public __struct__ getStruct() { throw new UnsupportedOperationException(getClass().toString()); } @@ -79,26 +75,6 @@ public class UnsupportedC implements __ptr__ { throw new UnsupportedOperationException(getClass().toString()); } - public __struct__ getStruct(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - - public boolean getBoolean(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - - public double getDouble(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - - public CString getCString(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - - public int getInt(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - public __ptr__ setPtr(String fieldName, __ptr__ data) { throw new UnsupportedOperationException(getClass().toString()); } @@ -111,10 +87,6 @@ public class UnsupportedC implements __ptr__ { throw new UnsupportedOperationException(getClass().toString()); } - public void setBoolean(String fieldName, boolean data) { - throw new UnsupportedOperationException(getClass().toString()); - } - public void setDouble(String fieldName, double data) { throw new UnsupportedOperationException(getClass().toString()); } @@ -123,9 +95,6 @@ public class UnsupportedC implements __ptr__ { throw new UnsupportedOperationException(getClass().toString()); } - public Object call(String name, Object... args) { - throw new UnsupportedOperationException(getClass().toString()); - } public Object addVirtualBytes(int bytes) { throw new UnsupportedOperationException(getClass().toString()); diff --git a/src/smetana/core/UnsupportedStarStruct.java b/src/smetana/core/UnsupportedStarStruct.java index 004ad10ab..9c84eda86 100644 --- a/src/smetana/core/UnsupportedStarStruct.java +++ b/src/smetana/core/UnsupportedStarStruct.java @@ -112,42 +112,14 @@ public class UnsupportedStarStruct implements StarStruct { throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); } - public void setBoolean(String fieldName, boolean data) { - throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); - } - public void setDouble(String fieldName, double data) { throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); } - public int getInt(String fieldName) { - throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); - } - - public double getDouble(String fieldName) { - throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); - } - - public boolean getBoolean(String fieldName) { - throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); - } - public __ptr__ plus(int pointerMove) { throw new UnsupportedOperationException(getClass().toString()); } - public CString getCString(String fieldName) { - throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); - } - - public __struct__ getStruct(String fieldName) { - throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); - } - - public __ptr__ getPtr(String fieldName) { - throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); - } - public void setStruct(String fieldName, __struct__ newData) { throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); } @@ -172,10 +144,6 @@ public class UnsupportedStarStruct implements StarStruct { throw new UnsupportedOperationException(getClass().toString()); } - public Object call(String fieldName, Object... args) { - throw new UnsupportedOperationException(fieldName + " " + getClass().toString()); - } - public __ptr__ castTo(Class dest) { System.err.println("I am " + toString() + " " + UID); throw new UnsupportedOperationException(dest + " " + getClass().toString()); diff --git a/src/smetana/core/UnsupportedStruct.java b/src/smetana/core/UnsupportedStruct.java index ff91e1494..fa5ef3c46 100644 --- a/src/smetana/core/UnsupportedStruct.java +++ b/src/smetana/core/UnsupportedStruct.java @@ -41,35 +41,10 @@ import smetana.core.amiga.StarStruct; public class UnsupportedStruct implements __struct__ { - public __ptr__ getPtr(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - - public __struct__ getStruct(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - - public boolean getBoolean(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - - public double getDouble(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - - public CString getCString(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - - public int getInt(String fieldName) { - throw new UnsupportedOperationException(getClass().toString()); - } - public __ptr__ setPtr(String fieldName, __ptr__ value) { throw new UnsupportedOperationException(getClass().toString()); } - public void setStruct(String fieldName, __struct__ value) { throw new UnsupportedOperationException(getClass().toString()); } @@ -78,10 +53,6 @@ public class UnsupportedStruct implements __struct__ { throw new UnsupportedOperationException(getClass().toString()); } - public void setBoolean(String fieldName, boolean value) { - throw new UnsupportedOperationException(getClass().toString()); - } - public void setDouble(String fieldName, double value) { throw new UnsupportedOperationException(getClass().toString()); } @@ -110,9 +81,5 @@ public class UnsupportedStruct implements __struct__ { throw new UnsupportedOperationException(getClass().toString()); } - public Object call(String name, Object... args) { - throw new UnsupportedOperationException(getClass().toString()); - } - } diff --git a/src/smetana/core/__array_of_cstring__.java b/src/smetana/core/__array_of_cstring__.java index 17e0142e9..d14c4658e 100644 --- a/src/smetana/core/__array_of_cstring__.java +++ b/src/smetana/core/__array_of_cstring__.java @@ -58,8 +58,5 @@ public interface __array_of_cstring__ extends Area { public void memcopyFrom(Area source); - public CString getCString(); - - public void setCString(CString value); } diff --git a/src/smetana/core/__array_of_cstring_impl__.java b/src/smetana/core/__array_of_cstring_impl__.java index 2455a6cad..095ca5d1a 100644 --- a/src/smetana/core/__array_of_cstring_impl__.java +++ b/src/smetana/core/__array_of_cstring_impl__.java @@ -145,12 +145,4 @@ public class __array_of_cstring_impl__ implements __array_of_cstring__ { // - public CString getCString() { - return (CString) getInternal(0); - } - - public void setCString(CString value) { - setInternalByIndex(0, value); - } - } diff --git a/src/smetana/core/__array_of_double__.java b/src/smetana/core/__array_of_double__.java index d064a4e7b..0afe8edb4 100644 --- a/src/smetana/core/__array_of_double__.java +++ b/src/smetana/core/__array_of_double__.java @@ -42,7 +42,6 @@ import java.util.List; import smetana.core.amiga.Area; import smetana.core.amiga.AreaInt; import smetana.core.amiga.BuilderArea; -import smetana.core.amiga.StarStruct; import smetana.core.amiga.Counter; public class __array_of_double__ implements Area { diff --git a/src/smetana/core/__array_of_ptr__.java b/src/smetana/core/__array_of_ptr__.java index dd7db2b6c..d2b227f22 100644 --- a/src/smetana/core/__array_of_ptr__.java +++ b/src/smetana/core/__array_of_ptr__.java @@ -64,24 +64,16 @@ public interface __array_of_ptr__ extends Area { public int getInt(); - public CString getCString(); - public __ptr__ getPtr(); public __struct__ getStruct(); public void setInt(int value); - public void setCString(CString value); - public void setPtr(__ptr__ value); public void setStruct(__struct__ value); - public double getDouble(String fieldName); - public void setDouble(String fieldName, double value); - public __struct__ getStruct(String fieldName); - } diff --git a/src/smetana/core/__c__fields.java b/src/smetana/core/__c__fields.java index 9c85ba19c..1b7856fe9 100644 --- a/src/smetana/core/__c__fields.java +++ b/src/smetana/core/__c__fields.java @@ -40,18 +40,10 @@ package smetana.core; public interface __c__fields { - public __ptr__ getPtr(String fieldName); - public __struct__ getStruct(String fieldName); - public boolean getBoolean(String fieldName); - public double getDouble(String fieldName); - public CString getCString(String fieldName); - public int getInt(String fieldName); - public __ptr__ setPtr(String fieldName, __ptr__ value); public void setStruct(String fieldName, __struct__ value); public void setInt(String fieldName, int value); - public void setBoolean(String fieldName, boolean value); public void setDouble(String fieldName, double value); diff --git a/src/smetana/core/__ptr__.java b/src/smetana/core/__ptr__.java index f6b0b7605..e172a68e7 100644 --- a/src/smetana/core/__ptr__.java +++ b/src/smetana/core/__ptr__.java @@ -61,7 +61,5 @@ public interface __ptr__ extends __c__fields { public __struct__ getStruct(); public void setStruct(__struct__ value); - public Object call(String name, Object... args); - } diff --git a/src/smetana/core/__struct__.java b/src/smetana/core/__struct__.java index 5ce2d4bac..8fa991f3e 100644 --- a/src/smetana/core/__struct__.java +++ b/src/smetana/core/__struct__.java @@ -51,6 +51,4 @@ public interface __struct__ extends __c__fields, Area { public StarStruct getInternalData(); - public Object call(String name, Object... args); - } diff --git a/src/smetana/core/amiga/StarArrayOfInteger.java b/src/smetana/core/amiga/StarArrayOfInteger.java index a52beabdc..84f262521 100644 --- a/src/smetana/core/amiga/StarArrayOfInteger.java +++ b/src/smetana/core/amiga/StarArrayOfInteger.java @@ -39,7 +39,6 @@ package smetana.core.amiga; import smetana.core.AllH; import smetana.core.UnsupportedC; import smetana.core.__array_of_integer__; -import smetana.core.__array_of_ptr__; import smetana.core.__ptr__; public class StarArrayOfInteger extends UnsupportedC implements Area, AllH { diff --git a/src/smetana/core/amiga/StarStruct.java b/src/smetana/core/amiga/StarStruct.java index c8efebb10..2ce069ade 100644 --- a/src/smetana/core/amiga/StarStruct.java +++ b/src/smetana/core/amiga/StarStruct.java @@ -37,10 +37,6 @@ package smetana.core.amiga; import smetana.core.AllH; -import smetana.core.CString; -import smetana.core.__array_of_cstring__; -import smetana.core.__array_of_integer__; -import smetana.core.__array_of_ptr__; import smetana.core.__ptr__; import smetana.core.__struct__; @@ -58,24 +54,10 @@ public interface StarStruct extends Area, AllH, InternalData { public void setInt(String fieldName, int data); - public void setBoolean(String fieldName, boolean data); - public void setDouble(String fieldName, double data); - public int getInt(String fieldName); - - public double getDouble(String fieldName); - - public boolean getBoolean(String fieldName); - public __ptr__ plus(int pointerMove); - public CString getCString(String fieldName); - - public __struct__ getStruct(String fieldName); - - public __ptr__ getPtr(String fieldName); - public void setStruct(String fieldName, __struct__ newData); public __ptr__ setPtr(String fieldName, __ptr__ newData); @@ -88,8 +70,6 @@ public interface StarStruct extends Area, AllH, InternalData { public void copyDataFrom(__ptr__ arg); - public Object call(String fieldName, Object... args); - public __ptr__ castTo(Class dest); public Object addVirtualBytes(int virtualBytes);