Skip to content

Commit

Permalink
Fix Checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxunn committed Oct 24, 2023
1 parent 1e0ccf7 commit 16e3922
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 41 deletions.
3 changes: 0 additions & 3 deletions src/main/java/seedu/address/logic/commands/ListCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ public class ListCommand extends Command {
public static final String COMMAND_WORD = "list";

public static final String MESSAGE_SUCCESS = "Listed all persons";

public static final String state = "list";

@Override
public CommandResult execute(Model model) {
requireNonNull(model);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/seedu/address/logic/commands/ViewCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
public class ViewCommand extends Command {

public static final String COMMAND_WORD = "view";
public static final String state = "view";

public static final String MESSAGE_SUCCESS = "Viewed Person Successfully";
private static final String state = "view";


public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Views the person identified by the index number used.\n"
+ "Parameters: INDEX (must be a positive integer)\n"
+ "Example: " + COMMAND_WORD + " 1";

public static final String MESSAGE_SUCCESS = "Viewed Person Successfully";

private static final Logger logger = LogsCenter.getLogger(ViewCommand.class);

private final Index targetIndex;
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/seedu/address/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,14 @@
import javafx.scene.input.KeyCombination;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.StackPane;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.scene.Scene;
import seedu.address.commons.core.GuiSettings;
import seedu.address.model.person.Person;
import seedu.address.commons.core.LogsCenter;
import seedu.address.logic.Logic;
import javafx.stage.StageStyle;
import seedu.address.logic.commands.CommandResult;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.person.Person;

/**
* The Main Window. Provides the basic application layout containing
Expand Down Expand Up @@ -176,6 +173,10 @@ private void handleExit() {
helpWindow.hide();
primaryStage.hide();
}

/**
* Handles the View Command.
*/
@FXML
public void handleView(Person selectedPerson, int displayedIndex) {
logger.info("handleView");
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/seedu/address/ui/ViewWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
import seedu.address.commons.core.LogsCenter;
import seedu.address.logic.commands.ViewCommand;
import seedu.address.model.person.Person;

/**
Expand All @@ -27,6 +26,8 @@ public class ViewWindow extends UiPart<Region> {
* @see <a href="https://github.com/se-edu/addressbook-level4/issues/336">The issue on AddressBook level 4</a>
*/

private static final Logger logger = LogsCenter.getLogger(ViewWindow.class);

public final Person person;

@FXML
Expand All @@ -46,15 +47,14 @@ public class ViewWindow extends UiPart<Region> {

@FXML
private Label otherInfo;
private static final Logger logger = LogsCenter.getLogger(ViewWindow.class);

/**
* Creates a {@code PersonCode} with the given {@code Person} and index to display.
*/
public ViewWindow(Person person, int displayedIndex) {
super(FXML);
this.person = person;
id.setText(displayedIndex + ".");
//id.setText(displayedIndex + ".");
name.setText(person.getName().fullName);
phone.setText(person.getPhone().value);
address.setText(person.getAddress().value);
Expand Down
Binary file added src/main/resources/images/application.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/images/email.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/images/home-address.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/resources/view/DarkTheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
}

#tags {
-fx-hgap: 7;
-fx-hgap: 10;
-fx-vgap: 3;
}

Expand Down
9 changes: 5 additions & 4 deletions src/main/resources/view/ViewWindow.css
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
#cardPane {
-fx-background-color: #FBFBD4;
}

.label {
-fx-font-family: "Arial";
-fx-font-size: 18px;
-fx-text-fill: black;
}

.cell_big_label {
-fx-font-size: 24px;
-fx-font-weight: bold;
-fx-text-fill: #666;
-fx-text-fill: black;
-fx-padding: 10px;
}


.cell_small_label {
-fx-font-size: 18px;
-fx-text-fill: #999;
-fx-text-fill: black;
-fx-padding: 5px;
}

64 changes: 41 additions & 23 deletions src/main/resources/view/ViewWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -11,63 +11,81 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.image.Image?>

<HBox id="cardPane" fx:id="cardPane" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<GridPane HBox.hgrow="ALWAYS">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10" prefWidth="150" />
</columnConstraints>
<VBox alignment="TOP_LEFT" minHeight="650" GridPane.columnIndex="0" VBox.vgrow="ALWAYS">
<padding>
<Insets top="5" right="5" bottom="5" left="15" />
<Insets top="20" right="5" bottom="30" left="15" />
</padding>
<HBox spacing="10" alignment="CENTER_LEFT">
<ImageView fx:id="profileImage" fitHeight="50" fitWidth="50">
<image>
<Image url="@/images/profile.png" />
</image>
</ImageView>
<Label fx:id="id" styleClass="cell_big_label">
<minWidth>
<!-- Ensures that the label text is never truncated -->
<Region fx:constant="USE_PREF_SIZE" />
</minWidth>
</Label>
<Label fx:id="name" text="\$first" styleClass="cell_big_label" />
<HBox spacing="2" alignment="CENTER_LEFT">
<ImageView fx:id="profileImage" fitHeight="50" fitWidth="50">
<image>
<Image url="@/images/profile.png" />
</image>
</ImageView>
<!-- <Label fx:id="id" styleClass="cell_big_label">-->
<!-- <minWidth>-->
<!-- <Region fx:constant="USE_PREF_SIZE" />-->
<!-- </minWidth>-->
<!-- </Label>-->
<Label fx:id="name" text="\$first" styleClass="cell_big_label" />
</HBox>
<Region prefHeight="5" />
<FlowPane fx:id="tags" />
<Region prefHeight="5" />
<HBox spacing="5" alignment="CENTER_LEFT">
<ImageView fx:id="phoneIcon" fitHeight="16" fitWidth="16">
<image>
<Image url="@/images/smartphone-call.png" />
</image>
</ImageView>
<Label styleClass="cell_small_label">
<text>Phone:</text>
</Label>
<Label fx:id="phone" styleClass="cell_small_label" text="\$phone" />
</HBox>
<!-- <Label fx:id="phone" styleClass="cell_small_label" text="\$phone" />-->
<HBox spacing="5" alignment="CENTER_LEFT">
<ImageView fx:id="addressIcon" fitHeight="16" fitWidth="16">
<image>
<Image url="@/images/home-address.png" />
</image>
</ImageView>
<Label styleClass="cell_small_label">
<text>Address:</text>
</Label>
<Label fx:id="address" styleClass="cell_small_label" text="\$address" />
</HBox>
<!-- <Label fx:id="address" styleClass="cell_small_label" text="\$address" />-->
<!-- <Label fx:id="email" styleClass="cell_small_label" text="\$email" />-->
<HBox spacing="5" alignment="CENTER_LEFT">
<ImageView fx:id="emailIcon" fitHeight="16" fitWidth="16">
<image>
<Image url="@/images/email.png" />
</image>
</ImageView>
<Label styleClass="cell_small_label">
<text>Email:</text>
</Label>
<Label fx:id="email" styleClass="cell_small_label" text="\$email" />
</HBox>
<HBox spacing="0" alignment="CENTER_LEFT">
<HBox spacing="5" alignment="CENTER_LEFT">
<ImageView fx:id="otherIcon" fitHeight="16" fitWidth="16">
<image>
<Image url="@/images/application.png" />
</image>
</ImageView>
<Label styleClass="cell_small_label">
<text>Additional Information:</text>
</Label>
<Label fx:id="otherInfo" styleClass="cell_small_label" text="to be added." />
</HBox>
<!-- <Label fx:id="otherInfo" styleClass="cell_small_label" text="Additional details to be added here" />-->
<HBox spacing="5" alignment="CENTER_LEFT">
<Label fx:id="otherInfo" styleClass="cell_small_label" />
</HBox>
</VBox>
</GridPane>
<stylesheets>
<URL value="@ViewWindow.css" />
</stylesheets>
</HBox>


</HBox>

0 comments on commit 16e3922

Please sign in to comment.