sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.core/src/com/nokia/carbide/cpp/pi/core/SessionPreferences.java
changeset 2 b9ab3b238396
child 12 ae255c9aa552
equal deleted inserted replaced
1:1050670c6980 2:b9ab3b238396
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the License "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: 
       
    15  *
       
    16  */
       
    17 
       
    18 package com.nokia.carbide.cpp.pi.core;
       
    19 
       
    20 public class SessionPreferences {
       
    21 	private static SessionPreferences instance;
       
    22 
       
    23 	private static final int WINDOW_DEFAULT_HEIGHT = 778;
       
    24 	private static final int WINDOW_DEFAULT_WIDTH = 1024;
       
    25 
       
    26 	private boolean barMode;
       
    27 	private boolean toolTipsEnabled;
       
    28 	private boolean fillAllEnabled;
       
    29 	private int windowWidth;
       
    30 	private int windowHeight;
       
    31 
       
    32 	private SessionPreferences() {
       
    33 //		 singleton
       
    34 //		setup defaults here
       
    35 		setWindowWidth(WINDOW_DEFAULT_WIDTH);
       
    36 		setWindowHeight(WINDOW_DEFAULT_HEIGHT);
       
    37 		setBarMode(false);
       
    38 		setToolTipsEnabled(true);
       
    39 		setFillAllEnabled(true);
       
    40 	}
       
    41 	
       
    42 	static public SessionPreferences getInstance() {
       
    43 		if (instance == null) {
       
    44 			instance = new SessionPreferences();
       
    45 		}
       
    46 		
       
    47 		return instance;
       
    48 	}
       
    49 	
       
    50 	public Object clone() throws CloneNotSupportedException {
       
    51 		throw new CloneNotSupportedException();
       
    52 	}
       
    53 
       
    54 	public int getWindowWidth() {
       
    55 		return windowWidth;
       
    56 	}
       
    57 	
       
    58 	public void setWindowWidth(int width) {
       
    59 		windowWidth = width;
       
    60 	}
       
    61 
       
    62 	public int getWindowHeight() {
       
    63 		return windowHeight;
       
    64 	}
       
    65 
       
    66 	public void setWindowHeight(int height) {
       
    67 		windowHeight = height;
       
    68 	}
       
    69 	
       
    70 	public boolean getBarMode() {
       
    71 		return barMode;
       
    72 	}
       
    73 	
       
    74 	public void setBarMode(boolean enabled) {
       
    75 		barMode = enabled;
       
    76 	}
       
    77 
       
    78 	public boolean getToolTipsEnabled() {
       
    79 		return toolTipsEnabled;
       
    80 	}
       
    81 
       
    82 	public void setToolTipsEnabled(boolean enabled) {
       
    83 		toolTipsEnabled = enabled;
       
    84 	}
       
    85 
       
    86 	public boolean getFillAllEnabled() {
       
    87 		return fillAllEnabled;
       
    88 	}
       
    89 
       
    90 	public void setFillAllEnabled(boolean enabled) {
       
    91 		fillAllEnabled = enabled;
       
    92 	}
       
    93 
       
    94 }