001: /*
002: * The contents of this file are subject to the
003: * Mozilla Public License Version 1.1 (the "License");
004: * you may not use this file except in compliance with the License.
005: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006: *
007: * Software distributed under the License is distributed on an "AS IS"
008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
009: * See the License for the specific language governing rights and
010: * limitations under the License.
011: *
012: * The Initial Developer of the Original Code is Simulacra Media Ltd.
013: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014: *
015: * All Rights Reserved.
016: *
017: * Contributor(s):
018: */
019:
020: package org.openharmonise.him.displaycomponents.table;
021:
022: import java.awt.Color;
023: import java.awt.Dimension;
024: import java.awt.FlowLayout;
025: import java.awt.Font;
026:
027: import javax.swing.Icon;
028: import javax.swing.JLabel;
029:
030: import org.openharmonise.vfs.*;
031: import org.openharmonise.vfs.gui.*;
032:
033: /**
034: * Place holder for a blank version entry.
035: *
036: * @author Matthew Large
037: * @version $Revision: 1.1 $
038: *
039: */
040: public class BlankVersionEntry extends VersionEntry {
041:
042: /**
043: * Contructs a new blank version entry.
044: *
045: * @param sTitle Title
046: */
047: public BlankVersionEntry(String sTitle) {
048: super ();
049: this .setup(sTitle);
050: }
051:
052: /**
053: * Configures this blank version entry.
054: *
055: * @param sTitle Title
056: */
057: private void setup(String sTitle) {
058: Icon iIcon = IconManager.getInstance().getIcon("16-blank.gif");
059:
060: String fontName = "Dialog";
061: int fontSize = 11;
062: Font font = new Font(fontName, Font.PLAIN, fontSize);
063:
064: this .setPreferredSize(new Dimension(160, 40));
065: this .setSize(new Dimension(160, 40));
066: this .setBackground(Color.WHITE);
067: FlowLayout fl2 = new FlowLayout(FlowLayout.LEFT);
068: fl2.setHgap(0);
069: fl2.setVgap(0);
070: this .setLayout(fl2);
071:
072: JLabel title = new JLabel(sTitle);
073: title.setFont(font);
074: title.setPreferredSize(new Dimension(145, 16));
075: title.setIcon(iIcon);
076: this .add(title);
077:
078: this .doLayout();
079: }
080:
081: /**
082: * Constructs a new blank version entry.
083: *
084: * @param parentEntry Expanded table entry that this is part of
085: * @param vfs Virtual file system for this entry
086: * @param sFilepath Full path to resource that this entry represents
087: * @param sTitle Title
088: */
089: private BlankVersionEntry(TableEntry parentEntry,
090: AbstractVirtualFileSystem vfs, String sFilepath,
091: String sTitle) {
092: super (parentEntry, vfs, sFilepath, sTitle);
093: }
094:
095: /**
096: * Constructs a new blank version entry.
097: *
098: * @param parentEntry Expanded table entry that this is part of
099: * @param vfs Virtual file system for this entry
100: * @param sFilepath Full path to resource that this entry represents
101: * @param sTitle Title
102: * @param bDisplayIcon Display Icon
103: */
104: private BlankVersionEntry(TableEntry parentEntry,
105: AbstractVirtualFileSystem vfs, String sFilepath,
106: String sTitle, boolean bDisplayIcon) {
107: super(parentEntry, vfs, sFilepath, sTitle, bDisplayIcon);
108: }
109:
110: }
|