Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // *20030831, karlpeder* Also location is restored int x = viewItem.getIntegerWithDefault(ViewItem.WINDOW, ViewItem.POSITION_X_INT, DEFAULT_X); int y = viewItem.getIntegerWithDefault(ViewItem.WINDOW, ViewItem.POSITION_Y_INT, DEFAULT_Y); int w = viewItem.getIntegerWithDefault(ViewItem.WINDOW, ViewItem.WIDTH_INT, DEFAULT_WIDTH); int h = viewItem.getIntegerWithDefault(ViewItem.WINDOW, ViewItem.HEIGHT_INT, DEFAULT_HEIGHT); final boolean maximized = viewItem.getBooleanWithDefault( ViewItem.WINDOW, ViewItem.MAXIMIZED_BOOL, false); // if window is maximized -> ignore the window size properties // otherwise, use window size property // but ensure that the window is completly visible on the // desktop x = Math.max(x, 0); y = Math.max(y, 0); final Dimension dim = new Dimension(Math.min(w, screenSize.width - x), Math.min(h, screenSize.height - y)); final Point p = new Point(x, y); final Frame frame = this;
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // *20030831, karlpeder* Also location is restored int x = viewItem.getIntegerWithDefault(ViewItem.WINDOW, ViewItem.POSITION_X_INT, DEFAULT_X); int y = viewItem.getIntegerWithDefault(ViewItem.WINDOW, ViewItem.POSITION_Y_INT, DEFAULT_Y); int w = viewItem.getIntegerWithDefault(ViewItem.WINDOW, ViewItem.WIDTH_INT, DEFAULT_WIDTH); int h = viewItem.getIntegerWithDefault(ViewItem.WINDOW, ViewItem.HEIGHT_INT, DEFAULT_HEIGHT); final boolean maximized = viewItem.getBooleanWithDefault( ViewItem.WINDOW, ViewItem.MAXIMIZED_BOOL, false); // if window is maximized -> ignore the window size properties // otherwise, use window size property // but ensure that the window is completly visible on the // desktop x = Math.max(x, 0); y = Math.max(y, 0); final Dimension dim = new Dimension(Math.min(w, screenSize.width - x), Math.min(h, screenSize.height - y)); final Point p = new Point(x, y); final Frame frame = this;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/frame/DefaultContainer.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/frame/DefaultContainer.java
Method name: void loadPositions(ViewItem) Method name: void setContentPane(JPanel)
Number of AST nodes: 11 Number of AST nodes: 11
1
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
1
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
2
		// *20030831, karlpeder* Also location is restored
2
			// *20030831, karlpeder* Also location is restored
3
		int x = viewItem.getIntegerWithDefault(ViewItem.WINDOW,
3
			int x = viewItem.getIntegerWithDefault(ViewItem.WINDOW,
4
				ViewItem.POSITION_X_INT, DEFAULT_X);
4
					ViewItem.POSITION_X_INT, DEFAULT_X);
5
		int y = viewItem.getIntegerWithDefault(ViewItem.WINDOW,
5
			int y = viewItem.getIntegerWithDefault(ViewItem.WINDOW,
6
				ViewItem.POSITION_Y_INT, DEFAULT_Y);
6
					ViewItem.POSITION_Y_INT, DEFAULT_Y);
7
		int w = viewItem.getIntegerWithDefault(ViewItem.WINDOW,
7
			int w = viewItem.getIntegerWithDefault(ViewItem.WINDOW,
8
				ViewItem.WIDTH_INT, DEFAULT_WIDTH);
8
					ViewItem.WIDTH_INT, DEFAULT_WIDTH);
9
		int h = viewItem.getIntegerWithDefault(ViewItem.WINDOW,
9
			int h = viewItem.getIntegerWithDefault(ViewItem.WINDOW,
10
				ViewItem.HEIGHT_INT, DEFAULT_HEIGHT);
10
					ViewItem.HEIGHT_INT, DEFAULT_HEIGHT);
11
		final boolean maximized = viewItem.getBooleanWithDefault(
11
			final boolean maximized = viewItem.getBooleanWithDefault(
12
				ViewItem.WINDOW, ViewItem.MAXIMIZED_BOOL, false);
12
					ViewItem.WINDOW, ViewItem.MAXIMIZED_BOOL, false);
13
		// if window is maximized -> ignore the window size properties
13
			// if window is maximized -> ignore the window size properties
14
		// otherwise, use window size property
14
			// otherwise, use window size property
15
		// but ensure that the window is completly visible on the
15
			// but ensure that the window is completly visible on the
16
		// desktop
16
			// desktop
17
		x = Math.max(x, 0);
17
			x = Math.max(x, 0);
18
		y = Math.max(y, 0);
18
			y = Math.max(y, 0);
19
		final Dimension dim = new Dimension(Math.min(w, screenSize.width - x),
19
			final Dimension dim = new Dimension(Math.min(w, screenSize.width
20
				
21
Math.min(h, screenSize.height - y));
20
					- x), Math.min(h, screenSize.height - y));
22
		final Point p = new Point(x, y);
21
			final Point p = new Point(x, y);
23
		final Frame frame = this;
22
			final Frame frame = this;
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons0