Skip to main content
summaryrefslogtreecommitdiffstats
blob: 0d1cfcd8c1c7e3c07e0bad27eb33018ac20ad4ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*****************************************************************************
 * Copyright (c) 2013 Cedric Dumoulin.
 *
 *    
 * 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:
 *  Cedric Dumoulin  Cedric.dumoulin@lifl.fr - Initial API and implementation
 *
 *****************************************************************************/

package org.eclipse.papyrus.infra.core.sasheditor.pagesmodel;


/**
 * Base class for structure representing sash in Checker
 * @author cedric dumoulin
 *
 */
public abstract class AbstractSash extends PanelTerm {

	protected PanelTerm leftup;
	protected PanelTerm rightdown;
	
	/**
	 * Constructor.
	 *
	 */
	public AbstractSash(PanelTerm left, PanelTerm right) {
		this.leftup = left;
		this.rightdown = right;
	}
	
	/**
	 * Constructor.
	 *
	 * @param name
	 * @param up
	 * @param down
	 */
	public AbstractSash(String name, PanelTerm left, PanelTerm right) {
		super(name);
		this.leftup = left;
		this.rightdown = right;
	}

	/**
	 * @return the leftup
	 */
	public PanelTerm getLeftup() {
		return leftup;
	}

	/**
	 * @return the rightdown
	 */
	public PanelTerm getRightdown() {
		return rightdown;
	}

	/**
	 *
	 * @param visitor
	 * @throws PagesModelException 
	 */
	abstract public <M> void accept(IPagesModelVisitor<M> visitor, M modelObject) throws PagesModelException ;

	/**
	 * @return The name used in toString
	 */
	protected abstract String getStringName();

	/**
	 * @see java.lang.Object#toString()
	 *
	 * @return
	 */
	@Override
	public String toString() {
		
		StringBuffer buff = new StringBuffer(getStringName());
		
		buff.append("(");
		buff.append(leftup.toString());
		buff.append(", ");
		buff.append(rightdown.toString());
		buff.append(")");
		
		return buff.toString();
	}

}

Back to the top