/***************************************************************************** * $Id: DisplayObject.java,v 1.1.1.1 2000/03/29 22:58:14 kkeys Exp $ * * File: DisplayObject.java Name:DisplayObject * Interface: DisplayObject.java * Goal: Create a interactive panel. Which will display nodes * and links. It will also allow a GUI for thier * creation, manipulation, and destruction * * Written: Bradley Huffaker (12/17/97) * * Modified: Jaeyeon Jung (2/13/98) * To hold lat/long/city. * * For:Cooperative Association for Internet Data Analysis ****************************************************************************** ****************************************************************************** By accessing this software, DISPLAYOBJECT, you are duly informed of and agree to be bound by the conditions described below in this notice: This software product, DISPLAYOBJECT, is developed by Bradley Huffaker, and Jaeyeon Jung copyrighted(C) 1998 by the University of California, San Diego (UCSD), with all rights reserved. UCSD administers the NLANR Cache grants, NCR-9796082 and NCR-9616602, under which most of this code was developed. There is no charge for DISPLAYOBJECT software. You can redistribute it and/or modify it under the terms of the GNU General Public License, v. 2 dated June 1991 which is incorporated by reference herein. DISPLAYOBJECT is distributed WITHOUT ANY WARRANTY, IMPLIED OR EXPRESS, OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE or that the use of it will not infringe on any third party's intellectual property rights. You should have received a copy of the GNU GPL along with the DISPLAYOBJECT program. Copies can also be obtained from http://www.gnu.org/copyleft/gpl.html or by writing to University of California, San Diego SDSC/CAIDA/NLANR 9500 Gilman Dr., MS-0505 La Jolla, CA 92093 - 0505 USA Or contact INFO@NLANR.NET *****************************************************************************/ package bhuffake.plankton; import java.awt.*; public class DisplayObject { /**************************************************** * Commain varialbes *****************************************************/ Color default_color = Color.black; Color color = default_color; Color selected_color = Color.green; // switch between draw large or little boolean little = false; // The size of the object int size; int little_size = 1; // The rank of the object int rank; // Number of requests boolean requestSet = false; int http_requests = 0; Color http_color; int icp_requests = 0; Color icp_color; boolean set_to_http_color = false; boolean set_to_icp_color = false; // Latitude and longitude -jae boolean set_geo = false; boolean on_map = false; double lat = 91.0; double lon = 181.0; String city = " "; // Domain color stuff Color domain_color; boolean exists = true; // Animation Stuff // Rembers if the object exists at all boolean[] exists_in_file; // Remebers if the object has had its request set boolean[] requestSet_in_file; // Keeps track of the files http_request int[] http_requests_in_file; // Keeps track of the icp requests a file int[] icp_requests_in_file; // Keeps track of the color by file Color[] color_in_file = new Color[1]; Color[] http_color_in_file; Color[] icp_color_in_file; Color[] domain_color_in_file; int current_fileIndex = 0; int num_files = 1; // Keeps track of weather the object is currently colored boolean colored = false; boolean hidden = false; /**************************************************** * Purpose: To allow for the DList to sort be sorted *****************************************************/ public boolean greater(DisplayObject object) { return false; } public double near(int x, int y){ return -1; } public void setSelect(boolean input){} public boolean isSelected(){ return false; } public void setHighlight(boolean input) {} public boolean isHighlighted() { return false;} public void setColor(Color color_input) { color = color_input; color_in_file[current_fileIndex] = color; } public void setToDefaultColor() { color = default_color; color_in_file[current_fileIndex] = color; colored = false; setToHTTPColor(false); setToICPColor(false); } public boolean isSetToHTTPColor() { return set_to_http_color; } public boolean isSetToICPColor() { return set_to_icp_color; } public void setToHTTPColor(boolean flag) { set_to_http_color = flag; } public void setToICPColor(boolean flag) { set_to_icp_color = flag; } public void setHTTPColor(Color input) { http_color = input; http_color_in_file[current_fileIndex] = input; } public void setICPColor(Color input) { icp_color = input; icp_color_in_file[current_fileIndex] = input; } public void setDomainColor(Color input) { domain_color = input; domain_color_in_file[current_fileIndex] = input; } public void setToDomainColor() { color = domain_color; colored = true; setToHTTPColor(false); } public void setToHTTPColor() { color = http_color; colored = true; setToHTTPColor(true); } public void setToICPColor() { color = icp_color; colored = true; setToICPColor(true); } public int getSize() { /* if (little) return little_size; else */ return size; } public void setSize(int size_input) { size = size_input;} public void hide() { hidden = true;} public void show() { hidden = false;} public boolean hidden() { return hidden;} public int getRank() {return rank;} public void setRank(int rank_input) { rank = rank_input;} public void draw(Graphics g, Dimension dim, double[] latlon){} public DisplayObject[] remove() {return new DisplayObject[0]; } public void removeObject(DisplayObject displayObject){} public void setLittle(boolean value) { little = value; } public boolean getLittle() { return little; } public String getString(){ return ""; } public DisplayObject getParent(){ return null; } public DisplayObject getChild() { return null; } public int getDirection() {return 0;} public void setXY(int x, int y){} public int[] getXY(){ return null; } public void changeXY(int delta_x, int delta_y){} public void setRequest(int http_input, int icp_input) { requestSet = true; http_requests = http_input; icp_requests = icp_input; } public void setGeo(double lat_input, double lon_input, String city_input) { lat = lat_input; lon = lon_input; city = city_input; setGeo(true); } public void setGeo(double lat_input, double lon_input) { lat = lat_input; lon = lon_input; setGeo(true); } public void setGeo(boolean flag) { set_geo = flag; } public boolean isSetGeo() { return set_geo; } public void onMap(boolean flag) { on_map = flag; } public boolean isOnMap() { return on_map; } public int getHTTPRequest() { return http_requests; } public void setHTTPRequest(int value) { http_requests = value; } public int getICPRequest() { return icp_requests; } public void setICPRequest(int value) { icp_requests = value; } public double getLatitude() { return lat;} public void setLatitude(double value) { lat = value; } public double getLongitude() { return lon;} public void setLongitude(double value) { lon = value; } // ---------------------- Animation Stuff -------------------- public void setUpFiles() { exists_in_file = new boolean[num_files]; requestSet_in_file = new boolean[num_files]; http_requests_in_file = new int[num_files]; icp_requests_in_file = new int[num_files]; color_in_file = new Color[num_files]; http_color_in_file = new Color[num_files]; icp_color_in_file = new Color[num_files]; domain_color_in_file = new Color[num_files]; for( int index=0; index < num_files; index++) { exists_in_file[index] = false; requestSet_in_file[index] = false; color_in_file[index] = default_color; http_color_in_file[index] = default_color; icp_color_in_file[index] = default_color; } } public boolean exists() { return exists; } public boolean exists(int fileIndex) { return exists_in_file[fileIndex]; } public void setExists(int fileIndex) { current_fileIndex = fileIndex; exists_in_file[fileIndex] = true; } public void setRequest(int http_input, int icp_input,int fileIndex) { requestSet = true; http_requests = http_input; icp_requests = icp_input; requestSet_in_file[fileIndex] = true; http_requests_in_file[fileIndex] = http_input; icp_requests_in_file[fileIndex] = icp_input; color = color_in_file[fileIndex]; } public void setFileIndex(int fileIndex) { current_fileIndex = fileIndex; exists = exists_in_file[fileIndex]; requestSet = requestSet_in_file[fileIndex]; http_requests = http_requests_in_file[fileIndex]; icp_requests = icp_requests_in_file[fileIndex]; color = color_in_file[fileIndex]; http_color = http_color_in_file[fileIndex]; icp_color = icp_color_in_file[fileIndex]; } }