Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Worked on issue #18 Waiting to test it to confirm completion.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaywandAmin committed Mar 27, 2015
1 parent 4c6211f commit ce4ed61
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 15 deletions.
43 changes: 30 additions & 13 deletions src/ItemDetailViewController.form
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="ItemDetailViewController">
<grid id="27dc6" binding="panel" layout-manager="GridLayoutManager" row-count="5" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="panel" layout-manager="GridLayoutManager" row-count="8" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="9" y="20" width="537" height="320"/>
Expand All @@ -16,7 +16,7 @@
<children>
<component id="60ad3" class="javax.swing.JLabel" binding="itemName">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Heiti SC" size="13"/>
Expand All @@ -25,26 +25,36 @@
</component>
<component id="dcc4c" class="javax.swing.JLabel" binding="price">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Heiti SC" size="13"/>
<text value=""/>
</properties>
</component>
<component id="dd575" class="javax.swing.JLabel" binding="itemDescription">
<component id="73f3d" class="javax.swing.JLabel" binding="logoLabel">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Heiti SC" size="13"/>
<text value=""/>
</properties>
</component>
<component id="e7324" class="javax.swing.JTextArea" binding="itemDescription">
<constraints>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="50" height="50"/>
</grid>
</constraints>
<properties>
<background color="-1118482"/>
<text value=""/>
</properties>
</component>
<grid id="d7250" binding="BottomPanel" layout-manager="GridLayoutManager" row-count="1" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-6447715"/>
Expand Down Expand Up @@ -89,14 +99,21 @@
</component>
</children>
</grid>
<component id="73f3d" class="javax.swing.JLabel" binding="logoLabel">
<vspacer id="7238">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
</vspacer>
<vspacer id="b0322">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<vspacer id="1f7a0">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</children>
</grid>
</form>
7 changes: 5 additions & 2 deletions src/ItemDetailViewController.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class ItemDetailViewController extends ViewController {
private JLabel itemName;
private JLabel price;
private JLabel itemDescription;
private JTextArea itemDescription ;
private JComboBox quantityCmb;
private JPanel panel;
private JLabel priceTotalLabel;
Expand All @@ -18,6 +18,7 @@ public class ItemDetailViewController extends ViewController {
private JLabel logoLabel;
final private Item item;


public ItemDetailViewController(Item item) {
this.item = item;
populateField();
Expand All @@ -44,8 +45,10 @@ public void itemStateChanged(ItemEvent e) {

public void populateField() {
itemName.setText(item.getName());
itemDescription.setText(item.getDescription());
price.setText("£ " + item.getPrice());
itemDescription.setText(item.getDescription());
itemDescription.setEditable(false);
itemDescription.setLineWrap(true);
}


Expand Down

0 comments on commit ce4ed61

Please # to comment.