utility
Class LinCal

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by utility.LinCal
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class LinCal
extends java.applet.Applet

LinCal is an applet designed to show when observing runs are scheduled and to give some basic information about these runs. The main display has a ScrollPane that shows the phase of the moon and what runs are scheduled on a given night. More detailed information about a run is shown when a user clicks on a run, and a night summary can be obtained by clicking on the date. At the bottom of the main display is a row of buttons that bring up windows allowing the user to control the way the runs are displayed, etc.

Priveleged users may (after logging on through the "Log On" button) add/delete/modify runs on the calendar.

Each day in a run is represented by a SearchBlock that looks something like , , or

The first represents a run that has been scheduled, the second is a proposed run, and the third is a run that is queue scheduled. In all the SearchBlocks, the first line is the name of the telescope, and the second is the type of run (search, photometry, spectra, etc.). The color is fairly arbitraty, but has something to do with where the telescope is located.

Clicking on a SearchBlock brings up a window that shows a bit more about a run. It looks something like:

The Observing Days show which days are included in the run, along with what fraction of the night is available for observations (0-1).

If the user were logged on (with database access priveleges), the Group and Observing Days TextFields would be editable, and the "Add Day" and "Send" buttons would be active. Such a user may change/delete the run dates and add more days. Clicking on the Send button updates the database with any changes. The reload button restores the fields as per their current database status.

Clicking on the "Sort..." button brings up a window such as:

To perform a sort, first select what parameter to sort by (group, type, or telescope), then number the entries in the order you wish them to be displayed. If a field is blank, negative, or not an integer, it will not be displayed. Giving the same number to one or more fields will group them together. Next click on "Do Sort" to reload the calendar, sorted as you have indicated. Select "NONE" on the Sort By Choice to perform no sorting, and pack all runs to the left (all dates in a run are shown in the same column).

The information below pertains to the java sorce code for the applet only and is not vital for its use.

See Also:
Serialized Form

Nested Class Summary
 class LinCal.Spacer
           
 
Field Summary
 java.awt.Button blogOn
           
 java.awt.Button bprint
           
 java.awt.Button breload
           
 java.awt.Button brun
           
 java.awt.Button bsort
           
 java.awt.Button btel
           
 java.awt.Panel buttonPanel
           
 java.awt.Color[] colors
           
 java.awt.Panel datePanel
           
 java.text.DateFormat df
           
 JulianDate endDay
           
 java.awt.Font font
           
 java.awt.GridBagConstraints gbc
           
 java.awt.GridBagLayout gbl
           
 java.util.Hashtable hash
           
static boolean isPrintable
           
 java.awt.Label ldate
           
 java.awt.Label lmoon
           
 LogOnBox lob
           
 java.awt.Label lrun
           
 boolean[] noPackLeft
           
 int numDaysToShow
           
 java.sql.ResultSet result
           
 RunSort rs
           
 java.lang.String[] scopeNames
           
 java.awt.ScrollPane scroll
           
 java.awt.Panel scrollPanel
           
 java.sql.Statement select
           
 JulianDate startDay
           
 int[] sums
           
 JulianDate tempjd
           
 java.awt.TextField tendDate
           
 java.awt.Font tfont
           
 java.awt.Panel titleRow
           
 java.awt.TextField tstartDate
           
 java.lang.String url
           
static UserWait uw
           
 WhatData wd
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
LinCal()
           
 
Method Summary
 void addScopes(java.awt.Container cont)
           
 void addScrollPanel()
           
 void doReload()
          reload all the runs
 JulianDate getDate(java.awt.TextField tf)
          parses the TextField for a date
 int getScopeCol(int[] rows)
           
 void getScopeNames()
           
 void init()
           
static boolean isColOccupied(int col, int sum)
           
 void lineUpCols(java.awt.Container cont)
          reset all the sums to the next completely free col
static void main(java.lang.String[] args)
          This runs the program from the command line
 void setRange()
          sets the range of the calendar
 java.lang.String[] sort(java.lang.String[] runs)
          sorts the runs
 int whichScope(java.lang.String scope)
           
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

startDay

public JulianDate startDay

endDay

public JulianDate endDay

tempjd

public JulianDate tempjd

url

public java.lang.String url

lob

public LogOnBox lob

select

public java.sql.Statement select

result

public java.sql.ResultSet result

scopeNames

public java.lang.String[] scopeNames

sums

public int[] sums

wd

public WhatData wd

isPrintable

public static boolean isPrintable

gbl

public java.awt.GridBagLayout gbl

gbc

public java.awt.GridBagConstraints gbc

numDaysToShow

public int numDaysToShow

font

public java.awt.Font font

tfont

public java.awt.Font tfont

df

public java.text.DateFormat df

colors

public java.awt.Color[] colors

tstartDate

public java.awt.TextField tstartDate

tendDate

public java.awt.TextField tendDate

rs

public RunSort rs

hash

public java.util.Hashtable hash

noPackLeft

public boolean[] noPackLeft

titleRow

public java.awt.Panel titleRow

scroll

public java.awt.ScrollPane scroll

scrollPanel

public java.awt.Panel scrollPanel

buttonPanel

public java.awt.Panel buttonPanel

datePanel

public java.awt.Panel datePanel

lmoon

public java.awt.Label lmoon

ldate

public java.awt.Label ldate

lrun

public java.awt.Label lrun

blogOn

public java.awt.Button blogOn

brun

public java.awt.Button brun

btel

public java.awt.Button btel

bsort

public java.awt.Button bsort

bprint

public java.awt.Button bprint

breload

public java.awt.Button breload

uw

public static UserWait uw
Constructor Detail

LinCal

public LinCal()
Method Detail

init

public void init()
Overrides:
init in class java.applet.Applet

addScrollPanel

public void addScrollPanel()

addScopes

public void addScopes(java.awt.Container cont)

sort

public java.lang.String[] sort(java.lang.String[] runs)
sorts the runs


isColOccupied

public static boolean isColOccupied(int col,
                                    int sum)

getScopeCol

public int getScopeCol(int[] rows)

lineUpCols

public void lineUpCols(java.awt.Container cont)
reset all the sums to the next completely free col


getScopeNames

public void getScopeNames()

whichScope

public int whichScope(java.lang.String scope)

main

public static final void main(java.lang.String[] args)
This runs the program from the command line


setRange

public void setRange()
sets the range of the calendar


getDate

public JulianDate getDate(java.awt.TextField tf)
parses the TextField for a date


doReload

public void doReload()
reload all the runs