concept
Class SchedulerFrame
- public class SchedulerFrame
- extends javax.swing.JFrame
Title: SchedulerFrame
Description: Main frame of Conference Scheduler -application.
Copyright: Copyright (c) 2006 CONCEPT-lisenssi Tekijänoikeus (c) 2006, Pekka Kuuva, Tatu Repo, Pasi Saari, Anna Seppänen. Kaikki oikeudet pidätetään. Tämän ohjelmiston levittäminen ja käyttö lähdekoodina ja binäärinä, muutettuna tai muuttamattomana, on sallittu edellyttäen, että seuraavat ehdot täytetään: 1. OHJELMISTON LEVITTÄMINEN Lähdekoodikopioissa, dokumentaatiossa ja muussa ohjelmiston mukana tulevassa aineistossa on oltava tämä lisenssi kokonaisuudessaan. 1.2. VIENTIRAJOITUKSET Ohjelmistoa tai sen osia ei saa viedä Amerikan Yhdysvaltoihin ilman tekijöiden erillistä suostumusta. 2. OHJELMISTON KÄYTTÖ (EULA) 2.1 KÄYTTÖEHDOT Ohjelmiston käyttäjän tulee joskus suorittaa vähintään yksi seuraavista toimista: a) Tarjota omalla kustannuksellaan olut tasokkaassa ravintolassa, pubissa tai muussa vastaavassa anniskelua harjoittavassa liikkeessä kullekin tekijöistä, sekä ilmoittaa tästä tarjouksesta. b) Tarjota tekijöille omalla kustannuksellaan pääsy tapahtumaan, jonka yhteydessä sovellusta on käytetty, ja ilmoittaa tästä tarjouksesta tekijöille. Ilmoittamisella tarkoitetaan vähintään viikkoa ennen tarjouk- sen täytäntöönpanoa tekijöille lähetettyä sähköpostia, jossa ilmoitetaan ohjelmiston käyttäjän nimi ja yhteystiedot sekä tarjous ja sen ajankohta. Jos käyttöehdot eivät ole täyttyneet, ohjelmistoa ei saa käyttää. 2.1. TAKUU Tekijänoikeuden haltijat ja ohjelmiston kehittäjät tarjoavat tämän ohjelmiston "sellaisena kuin se on". Sovellukselle ei myönnetä minkäänlaista takuuta kaupallisesti hyväksyttävästä laadusta eikä sen taata soveltuvan mihinkään tarkoitukseen. 2.2. VASTUUNRAJOITUS Tekijänoikeuden haltija ja ohjelmiston kehittäjät eivät ole missään tilanteessa vastuussa suorista, epäsuorista, yleisistä, erityisistä, satunnaisista tai seurauksellisista vahingoista (sisältäen, muttei tyhjentävästi, korvaavan tuotteen tai palvelun hankinnan, käyttömahdollisuuden, tiedon tai voittojen menetykset, tai liiketoiminnan keskeytymisen), jotka aiheutuvat miten tahansa ja millä tahansa vahingonkorvausoikeudellisella perusteella mukaanlukien sopimusvastuu, ankara vastuu ja sopimuksen ulkoinen vastuu (huolimattomuus tai muu), vaikka kyseisten vahinkojen mahdollisuudesta olisi kerrottu.
- Version:
- 1.0
- Author:
- Anna Seppänen
jbInit
private void jbInit()
- Component initialization.
- Throws:
java.lang.Exception
-
initialize
private void initialize()
- Initalization of application
updateConflicts
private void updateConflicts()
- Updates existing conflicts to conflictlist
initializeColors
private void initializeColors()
- Inititalization of correct Colors in Application
addGuides
private void addGuides()
- Adds some instructions to users in the screen
initializeComponentSize
private void initializeComponentSize()
- Expands frame and adjusts components to proper size
addTrees
private void addTrees()
- Adds and initializes session and presentation trees
sessionTree_selectionChanged
private void sessionTree_selectionChanged(javax.swing.event.TreeSelectionEvent e)
- Performed after sessionTree selection has changed. Inspects selected objects and clears selection if selection contains objects that represent different classes
- Parameters:
e
- TreeSelectionEvent
getTreeTooltip
private java.lang.String getTreeTooltip(java.awt.event.MouseEvent e)
- Performes after mouse has moved over trees. Handles the tool-tips of session and presentation trees
- Parameters:
e
- MouseEvent
- Returns:
- String tooltip
tree_mouseClicked
private void tree_mouseClicked(java.awt.event.MouseEvent e)
- Performed after trees have been clicked. Inspects wheather cliked object was session or presentation and sets object to be shown
- Parameters:
e
- MouseEvent
addDays
private void addDays()
- creates and adds timetable components and fills them with previously saved data
timeTable_mouseClicked
private void timeTable_mouseClicked(java.awt.event.MouseEvent e)
- Performed after timetable has been clicked. Inspects wheather clicked cell was upper left corner, block, hall, or other cell and commits proper action. Takes care of selection and deselection of whole timetable
- Parameters:
e
- MouseEvent
addHalls
private void addHalls()
- Adds all halls to hall list
fillComboBoxesAndTextFields
private void fillComboBoxesAndTextFields()
- initializes comboboxes and textfields to default value and colors
jComboBoxType_itemStateChanged
private void jComboBoxType_itemStateChanged(java.awt.event.ItemEvent e)
- Performed after combobox holding types of sessions or presentations has changed its value. Changes color if new value is default.
- Parameters:
e
- ItemEvent
jComboBoxKeyword_itemStateChanged
private void jComboBoxKeyword_itemStateChanged(java.awt.event.ItemEvent e)
- Performed after combobox holding keywords has changed its value. Changes color if new value is default.
- Parameters:
e
- ItemEvent
jComboBoxSessionTopic_itemStateChanged
private void jComboBoxSessionTopic_itemStateChanged(java.awt.event.ItemEvent e)
- Performed after combobox holding session topics has changed its value. Changes color if new value is default and loads chairmen in comboboxes.
- Parameters:
e
- ItemEvent
jComboBoxPresentationTopic_itemStateChanged
private void jComboBoxPresentationTopic_itemStateChanged(java.awt.event.ItemEvent e)
- Performed after combobox holding presentation topics has changed its value. Changes color if new value is default and loads keyword comboboxes.
- Parameters:
e
- ItemEvent
jComboBoxChairman_itemStateChanged
private void jComboBoxChairman_itemStateChanged(java.awt.event.ItemEvent e)
- Performed after combobox holding keywords has changed its value. Changes color if new value is default.
- Parameters:
e
- ItemEvent
timeTableBlockSelected
public void timeTableBlockSelected(concept.table.timetable.TimeTable timet)
- Unselects all other timetables than selected one. Enables block editing and sets selected block to fields for editing. Disables hall adding.
- Parameters:
timet
- TimeTable
clearBlockFields
private void clearBlockFields()
- Clears fields that show block data
showBlock
private void showBlock(concept.structure.Block b)
- Shows data of selected block
- Parameters:
b
- Block
timeTableHallSelected
public void timeTableHallSelected(concept.table.timetable.TimeTable timet)
- Unselects all other timetables than selected one. Disables block editing and disables hall adding.
- Parameters:
timet
- TimeTable
timeTableCellSelected
public void timeTableCellSelected(concept.table.timetable.TimeTable timet,
int row,
int col)
- Inspects chosen cell. If cell contains session shows it's data.
- Parameters:
timet
- TimeTable
row
- int
col
- int
timeTableAllSelected
public void timeTableAllSelected(concept.table.timetable.TimeTable timet)
- Deselects single selections from all timetables and activates hall and block addition
- Parameters:
timet
- TimeTable
timeTableUnselected
public void timeTableUnselected(concept.table.timetable.TimeTable timet)
- Performed after a timetable has been unselected. Disables hall and block adding if there is no other timetable selected.
- Parameters:
timet
- TimeTable
setHallEditingEnabled
public void setHallEditingEnabled(boolean active)
- Enables or disables adding halls to timetables
- Parameters:
active
- boolean
setBlockEditingEnabled
public void setBlockEditingEnabled(boolean active)
- Enables or disables adding and updating blocks
- Parameters:
active
- boolean
clearSessionFields
public void clearSessionFields()
- Clears data from session fields
setSessionFieldsOnlyForSearchingEnabled
private void setSessionFieldsOnlyForSearchingEnabled(boolean enabled)
- Enables or disables session fields that are not used for updating session data.
- Parameters:
enabled
- boolean
setPresentationFieldsEnabled
public void setPresentationFieldsEnabled(boolean enabled)
- Disables or enables session fields
- Parameters:
enabled
- boolean
clearPresentationFields
public void clearPresentationFields()
- Clears data from presentation fields
showSession
public void showSession(concept.structure.Session s)
- Shows data of session in session fields
- Parameters:
s
- Session
isChairmanInCombobox
private boolean isChairmanInCombobox(javax.swing.JComboBox combo,
concept.structure.Presenter cm)
- Checks if a chairman is currently in a combobox
- Parameters:
combo
- JComboBox
cm
- Presenter
- Returns:
- boolean is chairman in combobox
showPresentation
public void showPresentation(concept.structure.Presentation p)
- Shows a presentation in presentation fields.
- Parameters:
p
- Presentation
adjustPresentationButtons
public void adjustPresentationButtons()
- Checks out if there is presentation showed and enables or disables presentation buttons accordingly
adjustSessionButtons
public void adjustSessionButtons()
- Checks out if there is session showed and enables or disables session buttons accordingly
addConflicts
public void addConflicts(java.util.Vector conflicts)
- Adds given conflicts to conflict list.
- Parameters:
conflicts
- Vector
jMenuFileExit_actionPerformed
void jMenuFileExit_actionPerformed(java.awt.event.ActionEvent actionEvent)
- File | Exit action performed.
- Parameters:
actionEvent
- ActionEvent
jMenuItemSettings_actionPerformed
public void jMenuItemSettings_actionPerformed(java.awt.event.ActionEvent e)
- Settings action performed.
- Parameters:
e
- ActionEvent
jButtonClearPresentationTree_actionPerformed
public void jButtonClearPresentationTree_actionPerformed(java.awt.event.ActionEvent e)
- Clears selected items from presentation tree. If removed item is shown in presentation fields, clears also the fields.
- Parameters:
e
- ActionEvent
jButtonClearSessionTree_actionPerformed
public void jButtonClearSessionTree_actionPerformed(java.awt.event.ActionEvent e)
- Clears selected items from session tree. If removed item is shown in session fields, clears also the fields.
- Parameters:
e
- ActionEvent
getSelectedPresentationFromSessionTree
private concept.structure.Presentation getSelectedPresentationFromSessionTree()
- Return selected presentation from sessionTree, only if there is only single selection and selected item is presentation. Else returns null.
- Returns:
- Presentation, selected
jButtonPresentationUp_ActionPerformed
public void jButtonPresentationUp_ActionPerformed(java.awt.event.ActionEvent e)
- Asks datastructure to place presentation one place earlier from its current position. Produces update of session that contains the presentation in session tree.
- Parameters:
e
- ActionEvent
jButtonPresentationDown_ActionPerformed
public void jButtonPresentationDown_ActionPerformed(java.awt.event.ActionEvent e)
- Asks datastructure to place presentation one place later from its current position. Produces update of session that contains the presentation in session tree.
- Parameters:
e
- ActionEvent
jButtonCleanPresentationFields_actionPerformed
public void jButtonCleanPresentationFields_actionPerformed(java.awt.event.ActionEvent e)
- Clears presentation fields and adjusts presentation buttons.
- Parameters:
e
- ActionEvent
jButtonCleanSessionFields_actionPerformed
public void jButtonCleanSessionFields_actionPerformed(java.awt.event.ActionEvent e)
- Clears session fields and adjusts session buttons.
- Parameters:
e
- ActionEvent
jTextFieldPresentationTile_focusGained
public void jTextFieldPresentationTile_focusGained(java.awt.event.FocusEvent e)
- Takes care of foreground color and removing of default text when focus is gained
- Parameters:
e
- FocusEvent
jTextFieldPresentationTile_focusLost
public void jTextFieldPresentationTile_focusLost(java.awt.event.FocusEvent e)
- Takes care of foreground color and adds default text if necessary when focus is lost
- Parameters:
e
- FocusEvent
jTextAreaPresenter_focusGained
public void jTextAreaPresenter_focusGained(java.awt.event.FocusEvent e)
- Takes care of foreground color and removing of default text when focus is gained
- Parameters:
e
- FocusEvent
jTextAreaPresenter_focusLost
public void jTextAreaPresenter_focusLost(java.awt.event.FocusEvent e)
- Takes care of foreground color and adds default text if necessary when focus is lost
- Parameters:
e
- FocusEvent
timeTextField_FocusGained
public void timeTextField_FocusGained(java.awt.event.FocusEvent e)
- Takes care of foreground color and removing of default text when focus is gained
- Parameters:
e
- FocusEvent
timeTextField_FocusLost
public void timeTextField_FocusLost(java.awt.event.FocusEvent e)
- Takes care of foreground color and adds default text if necessary when focus is lost
- Parameters:
e
- FocusEvent
timeTextField_Verify
public boolean timeTextField_Verify(javax.swing.JComponent c)
- Verifies that input of textfield that representas time is in correct format.
- Parameters:
c
- JComponent
- Returns:
- boolean, is value valid
jSplitPaneDesktop_ancestorResized
public void jSplitPaneDesktop_ancestorResized(java.awt.event.HierarchyEvent e)
- Adjusts size of desktop splitpanels
- Parameters:
e
- HierarchyEvent
jTextFieldSessionCode_focusGained
public void jTextFieldSessionCode_focusGained(java.awt.event.FocusEvent e)
- Takes care of foreground color and removing of default text when focus is gained
- Parameters:
e
- FocusEvent
jTextFieldSessionCode_focusLost
public void jTextFieldSessionCode_focusLost(java.awt.event.FocusEvent e)
- Takes care of foreground color and adds default text if necessary when focus is lost
- Parameters:
e
- FocusEvent
jTextFieldSessionTitle_focusGained
public void jTextFieldSessionTitle_focusGained(java.awt.event.FocusEvent e)
- Takes care of foreground color and removing of default text when focus is gained
- Parameters:
e
- FocusEvent
jTextFieldSessionTitle_focusLost
public void jTextFieldSessionTitle_focusLost(java.awt.event.FocusEvent e)
- Takes care of foreground color and adds default text if necessary when focus is lost
- Parameters:
e
- FocusEvent
jButtonAddHalls_actionPerformed
public void jButtonAddHalls_actionPerformed(java.awt.event.ActionEvent e)
- Asks datastructure to add selected halls to selected days. Adds halls to timetables.
- Parameters:
e
- ActionEvent
jComboBoxKeywords_ancestorResized
public void jComboBoxKeywords_ancestorResized(java.awt.event.HierarchyEvent e)
- Adjusts size of keyword comboboxes
- Parameters:
e
- HierarchyEvent
jButtonAddBlock_actionPerformed
public void jButtonAddBlock_actionPerformed(java.awt.event.ActionEvent e)
- Updates block if there is a block that is selected to be shown. Else adds new block.
- Parameters:
e
- ActionEvent
updateBlock
private void updateBlock()
- Asks datastructure to update data of bloc with new values. Updates the block in timetable.
addBlock
private void addBlock()
- Asks datastructure to add new block to days that user has selected using times and blocktype that user has entered. Adds blocks to timetables.
jButtonUpdateSession_actionPerformed
public void jButtonUpdateSession_actionPerformed(java.awt.event.ActionEvent e)
- Asks datastructure to update data of session that is showed in session data fields by values that users has given. Causes session tree to update seession and clears fields.
- Parameters:
e
- ActionEvent
jButtonTimeTableRemove_actionPerformed
public void jButtonTimeTableRemove_actionPerformed(java.awt.event.ActionEvent e)
- Inspects all timetables, and if they contain selected elements asks datastructure to remove elements. If removed element contains sessions adds those sessions to sessiontree. Updates changes in timetables.
- Parameters:
e
- ActionEvent
jButtonPresentationSearch_actionPerformed
public void jButtonPresentationSearch_actionPerformed(java.awt.event.ActionEvent e)
- Asks datastructure to search presentations with given parameters. Adds search results in presentation tree.
- Parameters:
e
- ActionEvent
jButtonSessionSearch_actionPerformed
public void jButtonSessionSearch_actionPerformed(java.awt.event.ActionEvent e)
- Asks datastructure to search sessions with given parametres. Adds results to sessiontree and clears fields.
- Parameters:
e
- ActionEvent
jButtonAddSession_actionPerformed
public void jButtonAddSession_actionPerformed(java.awt.event.ActionEvent e)
- Asks datastructure to create session with values that user has entered. Adds new session to sessiontree and clears fields.
- Parameters:
e
- ActionEvent
jButtonDeleteSession_actionPerformed
public void jButtonDeleteSession_actionPerformed(java.awt.event.ActionEvent e)
- Asks datastructure to delete session. Moves presentations from session to session tree and clears fields
- Parameters:
e
- ActionEvent
getTimeTableOfSession
private concept.table.timetable.TimeTable getTimeTableOfSession(concept.structure.Session session)
- Returns TimeTable in which session is placed
- Parameters:
session
- Session
- Returns:
- TimeTable, may be null if session is not placed in any of the timetables
jButtonRemoveConflicts_actionPerformed
public void jButtonRemoveConflicts_actionPerformed(java.awt.event.ActionEvent e)
- Updates conflictlist.
- Parameters:
e
- ActionEvent
jSplitPaneLeft_ancestorResized
public void jSplitPaneLeft_ancestorResized(java.awt.event.HierarchyEvent e)
- Adjusts location of split panel splits.
- Parameters:
e
- HierarchyEvent
jTextFieldGrade_focusGained
public void jTextFieldGrade_focusGained(java.awt.event.FocusEvent e)
- Takes care of foreground color and removes default text when focus is gained.
- Parameters:
e
- FocusEvent
jTextFieldGrade_focusLost
public void jTextFieldGrade_focusLost(java.awt.event.FocusEvent e)
- Takes care of foreground color and adds default text if necessary when focus is lost.
- Parameters:
e
- FocusEvent
showFailedMessage
public void showFailedMessage()
- Informs user of failed action
presentationsTransferredFromPresentationTreeToSessionInSessionTree
public void presentationsTransferredFromPresentationTreeToSessionInSessionTree(concept.structure.Session s,
concept.structure.Presentation[] p)
- Asks datastructure to add presentations to session and presentes conflicts to user. Adds transferred presentation to session tree and removes them from presentation tree.
- Parameters:
s
- Session
p
- Presentation[]
presentationsTransferredFromSessionInSessionTreeToPresentationTree
public void presentationsTransferredFromSessionInSessionTreeToPresentationTree(concept.structure.Presentation[] p)
- Asks datastructure to remove presentations from session. Removes presentations from session tree and adds them to presentation tree
- Parameters:
p
- Presentation[]
presentationsTransferredInSessionTreeFromSessionToAnother
public void presentationsTransferredInSessionTreeFromSessionToAnother(concept.structure.Session target,
concept.structure.Presentation[] p)
- Asks datastructure to add presentations to new session and produces update of session tree.
- Parameters:
target
- Session
p
- Presentation[]
sessionTransferrdFromSessionTreeToTimeTable
public void sessionTransferrdFromSessionTreeToTimeTable(concept.table.timetable.TimeTable t,
concept.table.timetable.TimeTableCell c,
concept.structure.Session s)
- Asks datastructure to schedule session in selected hall and block. Adds session to timetable and removes it from old pace in timetable if session was previously scheduled.
- Parameters:
t
- TimeTable
c
- TimeTableCell
s
- Session
sessionTransferredFromTimetableToSessionTree
public void sessionTransferredFromTimetableToSessionTree(concept.table.timetable.TimeTable oldTable,
concept.structure.Session s)
- Asks datastructure to remove scheduledata of session. Removes session from timetable and adds it to sessionTree.
- Parameters:
oldTable
- TimeTable
s
- Session
sessionTransferredFromTimeTableToAnother
public void sessionTransferredFromTimeTableToAnother(concept.table.timetable.TimeTable oldTable,
concept.table.timetable.TimeTable newTable,
concept.table.timetable.TimeTableCell newCell,
concept.structure.Session s)
- Asks datastructure to shedule session again and produces update of session in session tree.
- Parameters:
oldTable
- TimeTable
newTable
- TimeTable
newCell
- TimeTableCell
s
- Session
sessionTransferredFromTimeTableToAnotherSessionInTimeTable
public void sessionTransferredFromTimeTableToAnotherSessionInTimeTable(concept.structure.Session replaced,
concept.structure.Session target)
- Asks datastructure swap two sessions between. Replaces sessions in timetables and produces update of sessions in session tree.
- Parameters:
replaced
- Session
target
- Session
sessionsTransferred
public void sessionsTransferred(concept.DndComponent source,
concept.DndComponent target,
concept.table.timetable.TimeTableCell targetCell,
concept.structure.Session[] sessions)
- Performed after sessions have ben dragged. Concludes next performed action based on given parameters.
- Parameters:
source
- DndComponent
target
- DndComponent
targetCell
- TimeTableCell
sessions
- Session[]
presentationsTransferred
public void presentationsTransferred(concept.DndComponent source,
concept.DndComponent target,
java.lang.Object targetObject,
concept.structure.Presentation[] presentations)
- Performed after presentations have been transferred. Concludes next performed action based on given parameters.
- Parameters:
source
- DndComponent
target
- DndComponent
targetObject
- Object
presentations
- Presentation[]
dragAccepted
public boolean dragAccepted(concept.DndComponent target,
concept.DndComponent source,
java.lang.Class flavorClass,
double x,
double y)
- Concludes wheather a drag can be accepted.
- Parameters:
target
- DndComponent
source
- DndComponent
flavorClass
- Class
x
- double
y
- double
- Returns:
- boolean, is drag accepted