Skip to content
Eugen Kiss edited this page Aug 24, 2013 · 35 revisions

This page should provide enough information to get you started with developing for ConExp-NG. Feel free to ask one of the contributers if you have further questions.

The following Maven commands may be of interest:

  • mvn compile: compile the project
  • mvn exec:exec: run the project
  • mvn package: create an executable jar in target
  • mvn javadoc:javadoc: create JavaDocs in target/site/apidocs

Code Architecture

TODO

  • Programstate

  • Computations-by-need:
    If you change the context, the calculations of the concepts will only start, if you switch to the lattice view (it's the same with implications and associations in the dependency view). We used the Swingworkerclass (see the oracle documentation), so the GUI will not frozen if you start an expensive calculation. The calculations will be canceled if you change the context, this happens through PropertyChangeMessages and the computations so far will be eliminated.

  • Undo-manager subtleties

  • Libraries (Batik, fcalib, lattice-algorithms, weblaf)

  • No unit-testing (is not worth the trouble for our GUI-focused application)

  • Package structure is roughly structured in the same hierarchical way as the gui

  • MV-Pattern can be found throughout the code, e.g. ContextMatrixModel & ContextMatrix, Programstate etc.

  • Swing best practices (see package.info)

  • More detailed/concrete information as comments in the source

  • The JavaDocs can currently be found at http://fcatools.github.io/conexp-ng/apidocs.

File Format

We extended the ConExp file format cex, so we can not only store the context and the lattice, but also the concepts, associations and implications, if they were computed. So you could open our cex file in ConExp and an old ConExp file in ConExp NG.

So the notation of the context hasn't changed (only the version to 2.0)

<?xml version="1.0" encoding="UTF-8"?>
<ConceptualSystem>
	<Version MajorNumber="2" MinorNumber="0"></Version>
	<Contexts>
		<Context Type="Binary" Identifier="0">
			<Attributes>
				<Attribute Identifier="0"><Name>attr0</Name></Attribute>
				<Attribute Identifier="1"><Name>attr1</Name></Attribute>
			</Attributes>
			<Objects>
				<Object><Name>obj0</Name><Intent><HasAttribute AttributeIdentifier="0"></HasAttribute><HasAttribute AttributeIdentifier="1"></HasAttribute></Intent></Object>
				<Object><Name>obj1</Name><Intent><HasAttribute AttributeIdentifier="1"></HasAttribute></Intent></Object>
			</Objects>
		</Context>
	</Contexts>

The associations and implications were added as pair of premise and consequent/conclusion.

	<Associations>
		<Association Support="0.5" Confidence="0.5">
			<Premise><HasAttribute AttributeIdentifier="1"></HasAttribute></Premise>
			<Consequent><HasAttribute AttributeIdentifier="0"></HasAttribute></Consequent>
		</Association>
	</Associations>
	<Implications>
		<Implication>
			<Premise><HasAttribute AttributeIdentifier="0"></HasAttribute></Premise>
			<Conclusion><HasAttribute AttributeIdentifier="1"></HasAttribute></Conclusion>
		</Implication>
	</Implications>

We added same settings to store the last appearance of the GUI.

	<Settings>
		<lastTab>2</lastTab><support>0.4</support><confidence>0.3</confidence><lexsorting>false</lexsorting><splitpanepos>206</splitpanepos><assoscrollpos>0</assoscrollpos><implscrollpos>0</implscrollpos><dependenciessettingssplitpos>170</dependenciessettingssplitpos><ColumnWidths></ColumnWidths><latticesettingssplitpos>170</latticesettingssplitpos>
	</Settings>

The nodes of the lattice are extended to store not only the intent, but also the extent, so the concepts can be extracted.

	<Lattices>
		<Lattice>
			<LineDiagram>
				<ConceptFigures>
					<LineDiagramFigure Type="Concept"><FigureCooords><Point2D x="252" y="190"></Point2D></FigureCooords><Intent><HasAttribute AttributeIdentifier="0"></HasAttribute><HasAttribute AttributeIdentifier="1"></HasAttribute></Intent><Extent><Object ObjectIdentifier="0"></Object></Extent></LineDiagramFigure>
					<LineDiagramFigure Type="Concept"><FigureCooords><Point2D x="197" y="89"></Point2D></FigureCooords><Intent><HasAttribute AttributeIdentifier="1"></HasAttribute></Intent><Extent><Object ObjectIdentifier="0"></Object><Object ObjectIdentifier="1"></Object></Extent></LineDiagramFigure>
				</ConceptFigures>

At the moment we only support Multilabels for the latticegraph, so with these settings the graph nearly looks the same in ConExp and ConExp NG.

				<LineDiagramSettings>
					<AttributeLabelsDisplayMode Value="AllAttribsMultiLabelsStrategy"></AttributeLabelsDisplayMode><ObjectLabelsDisplayMode Value="AllObjectsMultiLabelsStrategy"></ObjectLabelsDisplayMode><LabelFontSize Value="12"></LabelFontSize><ShowCollisions Value="false"></ShowCollisions><MaxNodeRadius Value="8"></MaxNodeRadius><EdgeDisplayMode Value="ConceptConnectionEdgeSizeCalcStrategy"></EdgeDisplayMode><HighlightMode Value="FilterIdealHighlightStrategy"></HighlightMode><GridSizeX Value="75"></GridSizeX><GridSizeY Value="55"></GridSizeY><Layout Value="MinIntersectionLayout"></Layout>
				</LineDiagramSettings>
				<UpConceptLabels>
					<LineDiagramFigure Type="ConceptLabel"><FigureCooords><Point2D x="332" y="174"></Point2D></FigureCooords><Intent><HasAttribute AttributeIdentifier="0"></HasAttribute><HasAttribute AttributeIdentifier="1"></HasAttribute></Intent></LineDiagramFigure>
					<LineDiagramFigure Type="ConceptLabel"><FigureCooords><Point2D x="288" y="89"></Point2D></FigureCooords><Intent><HasAttribute AttributeIdentifier="1"></HasAttribute></Intent></LineDiagramFigure>
				</UpConceptLabels>
				<ConceptLabels>
					<LineDiagramFigure Type="ConceptLabel"><FigureCooords><Point2D x="299" y="258"></Point2D></FigureCooords><Intent><HasAttribute AttributeIdentifier="0"></HasAttribute><HasAttribute AttributeIdentifier="1"></HasAttribute></Intent></LineDiagramFigure>
					<LineDiagramFigure Type="ConceptLabel"><FigureCooords><Point2D x="113" y="90"></Point2D></FigureCooords><Intent><HasAttribute AttributeIdentifier="1"></HasAttribute></Intent></LineDiagramFigure>
				</ConceptLabels>
			</LineDiagram>
		</Lattice>
	</Lattices>
</ConceptualSystem>

Adding a new layout algorithm

code structure

For adding an new algorithm for computing the lattice graph nodes' positions, you have to implemented the interface ILatticeAlgorithm. The method computeLatticeGraphPositions(...) forwards a graph and the viewport's dimensions. This graph contains already initialized nodes with correct y-values and random x-values, this means, that only the x-values has to be improved. Furthermore, each node contains an objects set and an attributes set corresponding to his representing concept and a set of nodes below them.

After you implemented an new algorithm, you have to add him into the HashMap algorithms contained in LatticeGraphComputer by a self-chosen name. Now, you can use chooseAlgorithm(...) to choose your new algrothim, befor you call the method computeLatticeGraph(...).

Website

TODO: tut on how to build website, e.g. cloning gh-pages and putting javadocs into /javadocs etc.

  • Clone the gh-pages branch: git clone -b gh-pages https://github.com/fcatools/conexp-ng.git conexp-ng.site
  • The website content is now in the folder conexp-ng.site.
  • To update the JavaDocs remove the folder conexp-ng.site/apidocs and replace it with the folder conexp-ng/target/site/apidocs after you have run mvn javadoc:javadoc in conexp-ng, commit & push.

Contributing

TODO

  • Either fork ConExp-NG and send a pull request or, if you want to work for a longer period of time on ConExp-NG, ask rjoberon if he could make you a collaborator for ConExp-NG
  • Please, feel free to contribute. Changes & improvements are welcome.
  • Please only spaces no tabs
  • Please set your editor width to 120

Setting up Eclipse

Install m2eclipse and import the project as an "Existing Maven Project". Create the following run configuration in order to make it easy to run the project from within eclipse:

If you encounter the following annoying error "Failed to load class org.slf4j.impl.StaticLoggerBinder" then take a look at this Stackoverflow suggestion (be sure to read stefan.at.wpf's comments). As a general rule, do not use m2eclipse's embedded maven. Instead, use your system's Maven installation.

You can also use IntelliJ IDEA as an alternative which has built-in Maven support.

Notes

ConExp-NG

Clone this wiki locally