com.sun.electric.tool.cvspm
Class CVSLibrary

java.lang.Object
  extended by com.sun.electric.tool.cvspm.CVSLibrary

public class CVSLibrary
extends java.lang.Object

Track the state of a library that has been checked into CVS. User: gainsley Date: Mar 16, 2006


Nested Class Summary
protected static class CVSLibrary.LibsCells
           
 
Method Summary
static void addLibrary(Library lib)
          Add a library to the list of CVS libraries, that will maintain the known state of the library with respect to CVS.
static void closeLibrary(Library lib)
          Method called when closing library.
static CVSLibrary.LibsCells consolidate(java.util.List<Library> libs, java.util.List<Cell> cells)
          Remove cells from cell list if they are part of any library in libs list.
static java.awt.Color getColor(Cell.CellGroup cg)
           
static java.awt.Color getColor(Cell cell)
           
static java.awt.Color getColor(Library lib)
           
static java.awt.Color getColor(java.util.Set<State> states)
           
static java.awt.Color getColor(State state)
           
static CVSLibrary.LibsCells getInCVS(java.util.List<Library> libs, java.util.List<Cell> cells)
           
static CVSLibrary.LibsCells getInCVSSorted(java.util.List<Library> libs, java.util.List<Cell> cells)
          Get a list of libraries and cells that are in CVS.
static CVSLibrary.LibsCells getModified(java.util.List<Library> libs, java.util.List<Cell> cells)
           
static CVSLibrary.LibsCells getNotInCVS(java.util.List<Library> libs, java.util.List<Cell> cells)
          Check the specified libraries and cells are in cvs.
static State getState(Cell cell)
           
static State getState(Library lib)
           
static boolean hasUnknownCells(Library lib)
          Only for DELIBs, check if there are any cells in library that have state "UNKNOWN", and need to be added to CVS.
static boolean isEditing(Cell cell)
           
static boolean isEditing(Library lib)
           
static CVSLibrary.LibsCells notFromDELIB(java.util.List<Cell> cells)
          Get cells from passed in list of cells that are not from DELIB libraries.
static void removeLibrary(Library lib)
          Remove a library from the list of CVS libraries.
static void savedLibrary(Library lib)
          Command to run after saving library for non-delib type libraries
static void savedLibrary(Library lib, java.util.List<java.lang.String> deletedCellFiles, java.util.List<java.lang.String> writtenCellFiles)
          Hook for after a DELIB library was saved.
static void savingLibrary(Library lib)
          Method called when saving a library, BEFORE the library file(s) are written.
static void setEditing(Cell cell, boolean editing)
           
static void setEditing(Library lib, boolean editing)
           
static void setState(Cell cell, State state)
          Set state of a Cell
static void setState(Library lib, State state)
          Set state of all Cells in a library
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addLibrary

public static void addLibrary(Library lib)
Add a library to the list of CVS libraries, that will maintain the known state of the library with respect to CVS. The known state specifies the color mapping of libraries and cells in the explorer tree.

Parameters:
lib -

removeLibrary

public static void removeLibrary(Library lib)
Remove a library from the list of CVS libraries.

Parameters:
lib -

getNotInCVS

public static CVSLibrary.LibsCells getNotInCVS(java.util.List<Library> libs,
                                               java.util.List<Cell> cells)
Check the specified libraries and cells are in cvs. Return any libs and cells that are not in cvs

Parameters:
libs - a List of Libraries to check.
cells - a List of Cells to check.
Returns:
Libraries and Cells that are not in CVS.

getInCVS

public static CVSLibrary.LibsCells getInCVS(java.util.List<Library> libs,
                                            java.util.List<Cell> cells)

getModified

public static CVSLibrary.LibsCells getModified(java.util.List<Library> libs,
                                               java.util.List<Cell> cells)

consolidate

public static CVSLibrary.LibsCells consolidate(java.util.List<Library> libs,
                                               java.util.List<Cell> cells)
Remove cells from cell list if they are part of any library in libs list. Return the consolidated list of libs and cells.

Parameters:
libs - the List of Libraries to consolidate.
cells - the List of Cells to consolidate.
Returns:
a LibsCells with the all desired Libraries and Cells.

notFromDELIB

public static CVSLibrary.LibsCells notFromDELIB(java.util.List<Cell> cells)
Get cells from passed in list of cells that are not from DELIB libraries.

Parameters:
cells - a List of Cells to examine.
Returns:
LibsCells of cells that are not from DELIB libraries.

getInCVSSorted

public static CVSLibrary.LibsCells getInCVSSorted(java.util.List<Library> libs,
                                                  java.util.List<Cell> cells)
Get a list of libraries and cells that are in CVS. This is sorted in the sense that the libraries returned will be JELIBS, and the cells returned are cells from DELIBS that are part of the original set of libs and cells.

Parameters:
libs - a list of Libraries
cells - a list of Cells
Returns:
a LibsCells with JELIBS libraries and DELIB cells that are in CVS.

hasUnknownCells

public static boolean hasUnknownCells(Library lib)
Only for DELIBs, check if there are any cells in library that have state "UNKNOWN", and need to be added to CVS.

Parameters:
lib - the Library to examine.
Returns:
true if such cells exist.

setState

public static void setState(Cell cell,
                            State state)
Set state of a Cell

Parameters:
cell -
state -

setState

public static void setState(Library lib,
                            State state)
Set state of all Cells in a library

Parameters:
lib -
state -

getColor

public static java.awt.Color getColor(Library lib)

getColor

public static java.awt.Color getColor(Cell cell)

getState

public static State getState(Library lib)

getState

public static State getState(Cell cell)

getColor

public static java.awt.Color getColor(Cell.CellGroup cg)

getColor

public static java.awt.Color getColor(State state)

getColor

public static java.awt.Color getColor(java.util.Set<State> states)

setEditing

public static void setEditing(Cell cell,
                              boolean editing)

isEditing

public static boolean isEditing(Cell cell)

setEditing

public static void setEditing(Library lib,
                              boolean editing)

isEditing

public static boolean isEditing(Library lib)

savingLibrary

public static void savingLibrary(Library lib)
Method called when saving a library, BEFORE the library file(s) are written.

Parameters:
lib -

savedLibrary

public static void savedLibrary(Library lib,
                                java.util.List<java.lang.String> deletedCellFiles,
                                java.util.List<java.lang.String> writtenCellFiles)
Hook for after a DELIB library was saved. This will do a CVS remove on any cells files that have been deleted (renamed). Note that this method is currently called only after a DELIB has been written, not after any other type of library.

Parameters:
lib -
deletedCellFiles -

savedLibrary

public static void savedLibrary(Library lib)
Command to run after saving library for non-delib type libraries

Parameters:
lib - the library

closeLibrary

public static void closeLibrary(Library lib)
Method called when closing library. Should be called after library is closed.

Parameters:
lib -