+/* vim: set ts=2: */
+/**
+ * Copyright (c) 2006 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions, and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * 3. Redistributions must acknowledge that this software was
+ * originally developed by the UCSF Computer Graphics Laboratory
+ * under support by the NIH National Center for Research Resources,
+ * grant P41-RR01081.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
package ext.edu.ucsf.rbvi.strucviz2;
import java.awt.Color;
*
* @return ChimeraModel
*/
+ @Override
public ChimeraModel getChimeraModel()
{
return this;
*
* @return user data
*/
+ @Override
public Object getUserData()
{
return userData;
* @param data
* user data to associate with this model
*/
+ @Override
public void setUserData(Object data)
{
this.userData = data;
*
* @return the selected state
*/
+ @Override
public boolean isSelected()
{
return selected;
* @param selected
* a boolean to set the selected state to
*/
+ @Override
public void setSelected(boolean selected)
{
this.selected = selected;
*
* @return the chains in this model as a list
*/
+ @Override
public List<ChimeraStructuralObject> getChildren()
{
return new ArrayList<ChimeraStructuralObject>(chainMap.values());
/**
* Checks if this model has selected children.
*/
+ @Override
public boolean hasSelectedChildren()
{
if (selected)
/**
* Return the Chimera specification for this model.
*/
+ @Override
public String toSpec()
{
if (subModelNumber == 0)
+ {
return ("#" + modelNumber);
+ }
return ("#" + modelNumber + "." + subModelNumber);
}
* Return a string representation for the model. Shorten if longer than 100
* characters.
*/
+ @Override
public String toString()
{
String modelName = "";
}
return nodeName;
}
+
+ @Override
+ public boolean equals(Object otherChimeraModel)
+ {
+ if (!(otherChimeraModel instanceof ChimeraModel))
+ {
+ return false;
+ }
+ ChimeraModel otherCM = ((ChimeraModel) otherChimeraModel);
+ return this.name.equals(otherCM.name)
+ && this.modelNumber == otherCM.modelNumber
+ && this.type == otherCM.type;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int hashCode = 1;
+ hashCode = hashCode * 37 + this.name.hashCode();
+ hashCode = hashCode * 37 + this.type.hashCode();
+ hashCode = (hashCode * 37) + modelNumber;
+ return hashCode;
+ }
}