Vergessen, neue Dateien zu committen.

This commit is contained in:
Servicepoint
2014-11-05 15:33:16 +01:00
parent a7acf646f9
commit ac90334cf1
5 changed files with 518 additions and 0 deletions

368
kBorrow.ucls Normal file
View File

@@ -0,0 +1,368 @@
<?xml version="1.0" encoding="UTF-8"?>
<class-diagram version="1.1.7" icons="true" always-add-relationships="false" generalizations="true" realizations="true"
associations="true" dependencies="false" nesting-relationships="true">
<class id="1" language="java" name="de.katho.kBorrow.Settings" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/Settings.java" binary="false" corner="BOTTOM_RIGHT">
<position height="207" width="183" x="430" y="1066"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<interface id="2" language="java" name="de.katho.kBorrow.db.DbConnector" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/db/DbConnector.java" binary="false" corner="BOTTOM_RIGHT">
<position height="225" width="217" x="1048" y="1066"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</interface>
<class id="3" language="java" name="de.katho.kBorrow.data.KUser" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/data/KUser.java" binary="false" corner="BOTTOM_RIGHT">
<position height="225" width="143" x="724" y="1066"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="4" language="java" name="de.katho.kBorrow.controller.UserController" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/controller/UserController.java" binary="false" corner="BOTTOM_RIGHT">
<position height="135" width="219" x="623" y="428"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="5" language="java" name="de.katho.kBorrow.models.ArticleModel" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/models/ArticleModel.java" binary="false" corner="BOTTOM_RIGHT">
<position height="351" width="176" x="2837" y="639"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="6" language="java" name="de.katho.kBorrow.listener.UserEditTableButton" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/listener/UserEditTableButton.java" binary="false" corner="BOTTOM_RIGHT">
<position height="99" width="243" x="1591" y="428"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="7" language="java" name="de.katho.kBorrow.gui.PanelUser" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/gui/PanelUser.java" binary="false" corner="BOTTOM_RIGHT">
<position height="351" width="211" x="623" y="37"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="8" language="java" name="de.katho.kBorrow.listener.NewLendingTableButton" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/listener/NewLendingTableButton.java" binary="false" corner="BOTTOM_RIGHT">
<position height="99" width="302" x="882" y="428"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="9" language="java" name="de.katho.kBorrow.listener.ArticleDeleteTableButton" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/listener/ArticleDeleteTableButton.java" binary="false" corner="BOTTOM_RIGHT">
<position height="99" width="352" x="1874" y="428"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="10" language="java" name="de.katho.kBorrow.db.SqlConnector" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/db/SqlConnector.java" binary="false" corner="BOTTOM_RIGHT">
<position height="243" width="217" x="1389" y="639"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="11" language="java" name="de.katho.kBorrow.controller.ArticleController" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/controller/ArticleController.java" binary="false" corner="BOTTOM_RIGHT">
<position height="135" width="235" x="2837" y="428"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="12" language="java" name="de.katho.kBorrow.gui.PanelManageLendings" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/gui/PanelManageLendings.java" binary="false" corner="BOTTOM_RIGHT">
<position height="99" width="205" x="43" y="37"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="13" language="java" name="de.katho.kBorrow.listener.TableButton" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/listener/TableButton.java" binary="false" corner="BOTTOM_RIGHT">
<position height="207" width="421" x="1591" y="37"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="14" language="java" name="de.katho.kBorrow.listener.ArticleEditTableButton" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/listener/ArticleEditTableButton.java" binary="false" corner="BOTTOM_RIGHT">
<position height="99" width="259" x="2266" y="428"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="15" language="java" name="de.katho.kBorrow.models.UserModel" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/models/UserModel.java" binary="false" corner="BOTTOM_RIGHT">
<position height="351" width="162" x="623" y="639"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="16" language="java" name="de.katho.kBorrow.gui.PanelNewLending" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/gui/PanelNewLending.java" binary="false" corner="BOTTOM_RIGHT">
<position height="171" width="232" x="2565" y="428"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="17" language="java" name="de.katho.kBorrow.listener.UserDeleteTableButton" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/listener/UserDeleteTableButton.java" binary="false" corner="BOTTOM_RIGHT">
<position height="99" width="327" x="1224" y="428"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="18" language="java" name="de.katho.kBorrow.gui.PanelArticle" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/gui/PanelArticle.java" binary="false" corner="BOTTOM_RIGHT">
<position height="351" width="219" x="2874" y="37"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="19" language="java" name="de.katho.kBorrow.gui.MainWindow" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/gui/MainWindow.java" binary="false" corner="BOTTOM_RIGHT">
<position height="135" width="153" x="430" y="639"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="20" language="java" name="de.katho.kBorrow.db.SqliteConnector" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/db/SqliteConnector.java" binary="false" corner="BOTTOM_RIGHT">
<position height="369" width="301" x="1048" y="639"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="21" language="java" name="de.katho.kBorrow.data.KArticle" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/data/KArticle.java" binary="false" corner="BOTTOM_RIGHT">
<position height="225" width="154" x="2701" y="1066"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<class id="22" language="java" name="de.katho.kBorrow.gui.MyFocusTraversalPolicy" project="kBorrow"
file="/kBorrow/src/de/katho/kBorrow/gui/MyFocusTraversalPolicy.java" binary="false" corner="BOTTOM_RIGHT">
<position height="189" width="295" x="288" y="37"/>
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</display>
</class>
<association id="23">
<bendpoint x="592" y="428"/>
<end type="SOURCE" refId="7" navigable="false">
<attribute id="24" name="userModel"/>
<multiplicity id="25" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="15" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<realization id="26">
<end type="SOURCE" refId="20"/>
<end type="TARGET" refId="2"/>
</realization>
<generalization id="27">
<end type="SOURCE" refId="6"/>
<end type="TARGET" refId="13"/>
</generalization>
<association id="28">
<end type="SOURCE" refId="15" navigable="false">
<attribute id="29" name="dbCon"/>
<multiplicity id="30" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="2" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<association id="31">
<end type="SOURCE" refId="32" navigable="false">
<attribute id="33" name="dbCon"/>
<multiplicity id="34" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="2" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<association id="35">
<end type="SOURCE" refId="15" navigable="false">
<attribute id="36" name="data"/>
<multiplicity id="37" minimum="0" maximum="2147483647"/>
</end>
<end type="TARGET" refId="3" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<generalization id="38">
<end type="SOURCE" refId="8"/>
<end type="TARGET" refId="13"/>
</generalization>
<association id="39">
<end type="SOURCE" refId="19" navigable="false">
<attribute id="40" name="dbCon"/>
<multiplicity id="41" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="2" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<association id="42">
<end type="SOURCE" refId="5" navigable="false">
<attribute id="43" name="dbCon"/>
<multiplicity id="44" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="2" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<association id="45">
<end type="SOURCE" refId="32" navigable="false">
<attribute id="46" name="data"/>
<multiplicity id="47" minimum="0" maximum="2147483647"/>
</end>
<end type="TARGET" refId="3" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<association id="48">
<end type="SOURCE" refId="7" navigable="false">
<attribute id="49" name="userController"/>
<multiplicity id="50" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="4" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<association id="51">
<end type="SOURCE" refId="4" navigable="false">
<attribute id="52" name="userModel"/>
<multiplicity id="53" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="15" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<association id="54">
<end type="SOURCE" refId="11" navigable="false">
<attribute id="55" name="articleModel"/>
<multiplicity id="56" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="5" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<association id="57">
<bendpoint x="1017" y="639"/>
<end type="SOURCE" refId="4" navigable="false">
<attribute id="58" name="dbCon"/>
<multiplicity id="59" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="2" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<realization id="60">
<end type="SOURCE" refId="10"/>
<end type="TARGET" refId="2"/>
</realization>
<generalization id="61">
<end type="SOURCE" refId="17"/>
<end type="TARGET" refId="13"/>
</generalization>
<association id="62">
<bendpoint x="3102" y="428"/>
<end type="SOURCE" refId="18" navigable="false">
<attribute id="63" name="articleModel"/>
<multiplicity id="64" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="5" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<association id="65">
<end type="SOURCE" refId="5" navigable="false">
<attribute id="66" name="data"/>
<multiplicity id="67" minimum="0" maximum="2147483647"/>
</end>
<end type="TARGET" refId="21" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<association id="68">
<end type="SOURCE" refId="18" navigable="false">
<attribute id="69" name="articleController"/>
<multiplicity id="70" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="11" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<generalization id="71">
<end type="SOURCE" refId="9"/>
<end type="TARGET" refId="13"/>
</generalization>
<generalization id="72">
<end type="SOURCE" refId="14"/>
<end type="TARGET" refId="13"/>
</generalization>
<association id="73">
<end type="SOURCE" refId="19" navigable="false">
<attribute id="74" name="set"/>
<multiplicity id="75" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="1" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<association id="76">
<bendpoint x="2798" y="639"/>
<end type="SOURCE" refId="11" navigable="false">
<attribute id="77" name="dbCon"/>
<multiplicity id="78" minimum="0" maximum="1"/>
</end>
<end type="TARGET" refId="2" navigable="true"/>
<display labels="true" multiplicity="true"/>
</association>
<classifier-display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
sort-features="false" accessors="true" visibility="true">
<attributes public="true" package="true" protected="true" private="true" static="true"/>
<operations public="true" package="true" protected="true" private="true" static="true"/>
</classifier-display>
<association-display labels="true" multiplicity="true"/>
</class-diagram>

BIN
lib/jdatepicker-1.3.4.jar Normal file

Binary file not shown.

View File

@@ -0,0 +1,73 @@
package de.katho.kBorrow.controller;
import de.katho.kBorrow.db.DbConnector;
import de.katho.kBorrow.models.ArticleModel;
public class ArticleController {
private DbConnector dbCon;
private ArticleModel articleModel;
public ArticleController(DbConnector pDbCon, ArticleModel pModel){
dbCon = pDbCon;
articleModel = pModel;
}
/**
* Erzeugt einen neuen Artikel in der Datenbank und aktualisiert die Tabelle
*
* @param pName Name des Artikels
* @param pDesc Beschreibung des Artikels
* @return 0: Artikel erfolgreich erzeugt
* 1: SQL-Fehler beim Erzeugen
* 2: Feld "Name" leer
*/
public int createArticle(String pName, String pDesc) {
int status = dbCon.createArticle(pName, pDesc);
articleModel.updateTable();
return status;
}
/**
* <20>ndert einen Artikel in der Datenbank und aktualisiert die Tabelle
*
* @param pId Id des Artikels, der ge<67>ndert werden soll
* @param pName (Neuer) Name des Artikels
* @param pDesc (Neue) Beschreibung des Artikels
* @return 0: Artikel erfolgreich ge<67>ndert
* 1: SQL-Fehler beim Erzeugen
* 2: Artikelname ist leer
*/
public int editArticle(int pId, String pName, String pDesc) {
int status = this.dbCon.editArticle(pId, pName, pDesc);
if(status == 0){
int row = articleModel.getRowFromId(pId);
articleModel.getArticleByRow(row).setName(pName);
articleModel.getArticleByRow(row).setDescription(pDesc);
articleModel.fireTableRowsUpdated(row, row);
}
return status;
}
/**
* L<>scht den Artikel mit der gegebenen ID in der Datenbank und aktualisiert die Tabelle.
*
* @param id ID des Artikels, der gel<65>scht werden soll.
* @return true, wenn der Artikel erfolgreich gel<65>scht wurde. false, wenn ein Fehler aufgetreten ist.
*/
public boolean deleteArticle(int id) {
if(this.dbCon.deleteArticle(id)){
int row = articleModel.getRowFromId(id);
articleModel.removeRow(row);
return true;
}
return false;
}
}

View File

@@ -0,0 +1,49 @@
package de.katho.kBorrow.controller;
import de.katho.kBorrow.db.DbConnector;
import de.katho.kBorrow.models.UserModel;
public class UserController {
private DbConnector dbCon;
private UserModel userModel;
public UserController(DbConnector pDbCon, UserModel pModel) {
dbCon = pDbCon;
userModel = pModel;
}
public int createUser(String pName, String pSurname){
int status = dbCon.createUser(pName, pSurname);
userModel.updateTable();
return status;
}
public int editUser(int pId, String pName, String pSurname) {
int status = dbCon.editUser(pId, pName, pSurname);
if(status == 0){
int row = userModel.getRowFromId(pId);
userModel.getUserByRow(row).setName(pName);
userModel.getUserByRow(row).setSurname(pSurname);
userModel.fireTableRowsUpdated(row, row);
}
return status;
}
public boolean deleteUser(int id){
if(dbCon.deleteUser(id)){
int row = userModel.getRowFromId(id);
userModel.removeRow(row);
return true;
}
return false;
}
}

View File

@@ -0,0 +1,28 @@
package de.katho.kBorrow.models;
import de.katho.kBorrow.db.DbConnector;
public class FreeArticleModel extends ArticleModel {
/**
*
*/
private static final long serialVersionUID = 1908669541941834593L;
private String[] header;
public FreeArticleModel(DbConnector pDbCon) {
super(pDbCon);
this.header = new String[] {"ID", "Artikelname", "Artikelbeschreibung", ""};
updateTable();
}
public void updateTable(){
data = dbCon.getFreeArticleList();
fireTableDataChanged();
}
public int getColumnCount(){
return header.length;
}
}