Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 2563518e

Přidáno uživatelem Tomáš Šimandl před více než 6 roky(ů)

Changed vertex.title to vertex.name and removed archetype.name from title

Zobrazit rozdíly:

sources/src/main/java/cz/zcu/kiv/offscreen/api/BaseVertex.java
10 10
    private int id;
11 11
    /** Identification number which is in input file. */
12 12
    private int originalId;
13
    /** Title of vertex. */
14
    private String title;
13
    /** Name of vertex. */
14
    private String name;
15 15
    /** Index of vertex archetype. */
16 16
    private int archetypeIndex;
17 17
    /** Additional info. */
18 18
    private String text;
19 19

  
20
    public BaseVertex(int id, int originalId, String title, int archetypeIndex, String text) {
20
    public BaseVertex(int id, int originalId, String name, int archetypeIndex, String text) {
21 21
        this.id = id;
22 22
        this.originalId = originalId;
23
        this.title = title;
23
        this.name = name;
24 24
        this.archetypeIndex = archetypeIndex;
25 25
        this.text = text;
26 26
    }
......
41 41
        this.originalId = originalId;
42 42
    }
43 43

  
44
    public String getTitle() {
45
        return title;
44
    public String getName() {
45
        return name;
46 46
    }
47 47

  
48
    public void setTitle(String title) {
49
        this.title = title;
48
    public void setName(String name) {
49
        this.name = name;
50 50
    }
51 51

  
52 52
    public int getArchetype() {
sources/src/main/java/cz/zcu/kiv/offscreen/api/Vertex.java
14 14
     * Create new vertex.
15 15
     * @param id new generated identification number.
16 16
     * @param originalId original identification number from input file
17
     * @param title title of vertex
17
     * @param name of vertex
18 18
     * @param archetypeIndex index of vertex archetype
19 19
     * @param text additional info
20 20
     * @param attributes List of all attributes. Every attribute is stored in String array in pair as {attribute name, attribute value}.
21 21
     */
22
    public Vertex(int id, int originalId, String title, int archetypeIndex, String text, List<String[]> attributes) {
23
        super(id, originalId, title, archetypeIndex, text);
22
    public Vertex(int id, int originalId, String name, int archetypeIndex, String text, List<String[]> attributes) {
23
        super(id, originalId, name, archetypeIndex, text);
24 24
        this.attributes = attributes;
25 25
    }
26 26

  
sources/src/main/java/cz/zcu/kiv/offscreen/graph/GraphManager.java
145 145
     * vertices with the archetypeIndex as the key.
146 146
     *
147 147
     * @param id             - ID of the vertex to add
148
     * @param title          - Title of the vertex
148
     * @param name           - Name of the vertex
149 149
     * @param text           - Text of the vertex
150 150
     * @param archetypeIndex - Type of archetype associated with this vertex
151 151
     * @param attributes     - Map of attributes associated with the vertex
152 152
     */
153
    public void addVertex(int id, String title, String text, int archetypeIndex, Map<Integer, Attribute> attributes) {
154
        VertexImpl vertexToAdd = new VertexImpl(id, id, title, archetypeIndex, text);
153
    public void addVertex(int id, String name, String text, int archetypeIndex, Map<Integer, Attribute> attributes) {
154
        VertexImpl vertexToAdd = new VertexImpl(id, id, name, archetypeIndex, text);
155 155
        if (vertices.containsKey(archetypeIndex)) {
156 156
            vertices.get(archetypeIndex).add(vertexToAdd);
157 157
        } else {
......
505 505
    private void addVerticesToGraph(Graph graph, Set<VertexImpl> resultVertices) {
506 506
        for (VertexImpl vertexImpl : resultVertices) {
507 507

  
508
            VertexArchetype archetype = vertexArchetypes.get(vertexImpl.getArchetype());
509
            String title = archetype.name + ":" + vertexImpl.getTitle();
510 508
            List<String[]> attributes = getAttributesAsArray(vertexImpl.getSortedAttributes());
511 509

  
512
            Vertex vertex = new Vertex(lastVertexOrGroupId++, vertexImpl.getOriginalId(), title, vertexImpl.getArchetype(), vertexImpl.getText(), attributes);
510
            Vertex vertex = new Vertex(
511
                    lastVertexOrGroupId++,
512
                    vertexImpl.getOriginalId(),
513
                    vertexImpl.getName(),
514
                    vertexImpl.getArchetype(),
515
                    vertexImpl.getText(),
516
                    attributes);
513 517

  
514 518
            graph.addVertex(vertexImpl.getId(), vertex);
515 519
        }
sources/src/main/java/cz/zcu/kiv/offscreen/graph/VertexImpl.java
15 15
     * Creates new vertex.
16 16
     * @param id new generated identification number.
17 17
     * @param originalId original identification number from input file
18
     * @param title title of vertex
18
     * @param name of vertex
19 19
     * @param archetypeIndex index of vertex archetype
20 20
     * @param text additional info
21 21
     */
22
    public VertexImpl(int id, int originalId, String title, int archetypeIndex, String text) {
23
        super(id, originalId, title, archetypeIndex, text);
22
    public VertexImpl(int id, int originalId, String name, int archetypeIndex, String text) {
23
        super(id, originalId, name, archetypeIndex, text);
24 24
        this.attributesMap = new HashMap<>();
25 25
    }
26 26

  

Také k dispozici: Unified diff