diff --git a/src/places/DescribedPlace.java b/src/places/DescribedPlace.java index 8a70b5d..60dc969 100644 --- a/src/places/DescribedPlace.java +++ b/src/places/DescribedPlace.java @@ -1,18 +1,42 @@ package places; +import java.awt.Color; +import java.awt.Graphics; + public class DescribedPlace extends Place{ private String description; - public DescribedPlace(String name, Position position, String description){ - super(name, position); +/*-------------------------------------------------CONSTRUCTOR--------------------------------------------------------*/ + public DescribedPlace(String name, Position position, Registry register, String description){ + super(name, position, register); this.description = description; + } + +/*---------------------------------------------------METHODS----------------------------------------------------------*/ + protected void paintPlaceInfo(Graphics g){ + + int newX = getSizeX() *3; // EXPERIMENT + int newY = getSizeY() *2; + + System.out.println(getSizeX()); + System.out.println(newX); + + this.setBounds(getPositionX()-15,getPositionY()-25, newX , newY); + + g.setColor(Color.WHITE); + g.fillRect(0, 0,getBounds().width-1, getBounds().height -1); + g.setColor(Color.BLACK); + g.drawString(getName(), 0, 0 + (getBounds().height - getSizeY())); + g.drawString(description, 0, 0 + (getBounds().height -1)); + + drawIfMarked(g); } - public DescribedPlace(String name, Position position, TravelCategory color, String description){ - super(name, position, color); - this.description = description; + @Override + public String toString() { + return "Described" +","+ getColor() +","+ getPosition().getX() +","+ getPosition().getY() +","+ getName() +","+ description; } } diff --git a/src/places/NamedPlace.java b/src/places/NamedPlace.java index eb247b8..3fc82c1 100644 --- a/src/places/NamedPlace.java +++ b/src/places/NamedPlace.java @@ -1,13 +1,37 @@ package places; +import java.awt.Color; +import java.awt.Graphics; + public class NamedPlace extends Place{ - public NamedPlace(String name, Position position){ - super(name, position); - +/*----------------------------------------------------CONSTRUCTOR--------------------------------------------------*/ + public NamedPlace(String name, Position position, Registry register){ + super(name, position, register); } - public NamedPlace(String name, Position position, TravelCategory color){ - super(name, position, color); + +/*------------------------------------------------------METHODS----------------------------------------------------*/ + @Override + protected void paintPlaceInfo(Graphics g) { + + int newX = getSizeX() *3; // EXPERIMENT + + System.out.println(getSizeX()); + System.out.println(newX); + this.setBounds(getPositionX()-15,getPositionY()-25, newX ,getSizeY() ); + + g.setColor(Color.WHITE); + g.fillRect(0, 0,getBounds().width-1, getBounds().height -1); + g.setColor(Color.BLACK); + g.drawString(getName(), 0, 0 + (getBounds().height -1)); + + drawIfMarked(g); + } + + @Override + public String toString() { + // TODO Auto-generated method stub + return "Named" +","+ getColor() +","+ getPosition().getX() +","+ getPosition().getY() +","+ getName(); } } diff --git a/src/places/Place.java b/src/places/Place.java index 0442c6e..7320936 100644 --- a/src/places/Place.java +++ b/src/places/Place.java @@ -1,41 +1,83 @@ package places; -import javax.swing.JComponent; // kanske ladda allt? alltsć -> * +import javax.swing.*; +import java.awt.*; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; public abstract class Place extends JComponent { private String name; private Position position; - private TravelCategory color = TravelCategory.NO_CATEGORY;// kategori - buss, tćg, t-bana - private boolean showInfo; - //private boolean visible; // behövs ej? JComponent -> setVisible() - private boolean marked; - - public Place(String name, Position position){ + private TravelCategory color; + private boolean showInfo = false; + private boolean marked = false; + private int sizeX = 30; + private int sizeY = 25; + Registry register; + +/*------------------------------------------------CONSTRUCTOR---------------------------------------------------------------*/ + public Place(String name, Position position, Registry register){ this.name = name; this.position = position; + this.register = register; + this.addMouseListener(new MarkLyss()); + this.setBounds(position.getX()-15,position.getY()-25,sizeX,sizeY); + this.setPreferredSize (new Dimension(100,100)); + this.setMaximumSize (new Dimension(100,100)); + this.setMinimumSize (new Dimension(100,100)); setVisible(true); } - public Place(String name, Position position, TravelCategory color){ - this(name, position); - this.color = color; - setVisible(true); - int i = 0; - } +/*-------------------------------------------------METHODS-------------------------------------------------------------------*/ public String getName(){ return name; - } // dessa getMetoder borde inte behövas dć den ärever frćn JComponent och alltsć - //ska representeras grafiskt som en trekant pć kartan. + } public Position getPosition(){ return position; } + public int getPositionX(){ + return position.getX(); + } + public int getPositionY(){ + return position.getY(); + } + public int getSizeX(){ + return sizeX; + } + public int getSizeY(){ + return sizeY; + } + + void setMarked(){ + marked = true; + repaint(); + } + + void setNotMarked(){ + marked = false; + repaint(); + } + + void setDontShowInfo(){ + showInfo = false; + repaint(); + } public TravelCategory getColor(){ return color; } + public void setCategory(TravelCategory color){ + try{ + this.color = color; + }catch(NullPointerException e){ + // Inget problem, dĂ„ Place kan va kategorilös! + } + } + + public boolean getShowInfo(){ return showInfo; } @@ -43,6 +85,118 @@ public boolean getMarked(){ return marked; } + public abstract String toString(); + public void drawIfMarked(Graphics g){ + if(marked){ + g.setColor(Color.RED); + g.drawRect(0, 0,getBounds().width-1, getBounds().height -1); + } + } + @Override + protected void paintComponent(Graphics g){ + if(showInfo){ + paintPlaceInfo(g); + }else{ + paintPlace(g); + // denna if-sats skulle kunna ligga utanför paintComponent + //och i sĂ„ fall kunde describedPlace istĂ€llet representeras av en pĂ„lagd panel med en textArea. + } + } + + private void paintPlace(Graphics g) { + super.paintComponent(g); + + this.setBounds(getPositionX()-15,getPositionY()-25, sizeX ,sizeY); + + g.setColor(Color.BLACK); + int[] xLed = {0,15,30}; + int[] yLed = {0,25,0}; + + if(color != null){ + switch(color.toString()){ + + case "BUS": + g.setColor(Color.RED); + break; + + case "TRAIN": + g.setColor(Color.GREEN); + break; + + case "SUBWAY": + g.setColor(Color.BLUE); + break; + default: + } + } + + g.fillPolygon(xLed, yLed, 3); + + drawIfMarked(g); + + } + protected abstract void paintPlaceInfo(Graphics g); // Utseende och Info definieras i varje given Place-child + +/*----------------------------------------------------------CLASSES---------------------------------------------------------*/ + class MarkLyss implements MouseListener{ + + + public void mouseClicked(MouseEvent mev){ + switch(mev.getButton()){ + + case MouseEvent.BUTTON1: + if(marked){ + marked = false; + register.getMarkedPlace().remove(Place.this); + //TA BORT UR MARKED LIST + } + else{ + marked = true; + register.getMarkedPlace().add(Place.this); + // LÄGG TILL I MARKEDLIST + } + repaint(); + break; + + case MouseEvent.BUTTON3: + if(showInfo) + showInfo = false; + else + showInfo = true; + repaint(); + break; + + default: + return; + } + } + + @Override + public void mouseEntered(MouseEvent arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void mouseExited(MouseEvent arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void mousePressed(MouseEvent arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void mouseReleased(MouseEvent arg0) { + // TODO Auto-generated method stub + + } + } } + + diff --git a/src/places/Position.java b/src/places/Position.java index d4cffd9..5950d06 100644 --- a/src/places/Position.java +++ b/src/places/Position.java @@ -4,16 +4,40 @@ public class Position { private int positionX; private int positionY; - + +/*-----------------------------------------------------CONSTRUCTOR------------------------------------------------------*/ public Position(int x, int y){ - x = positionX; - y = positionY; + positionX = x; + positionY = y; } +/*-------------------------------------------------------METHODS--------------------------------------------------------*/ public int getX(){ return positionX; } + public int getY(){ return positionY; } + + @Override + public boolean equals(Object o){ // till för jĂ€mförelser i hashMap + + if(o instanceof Position){ + + Position comparePos=(Position)o; + + if(comparePos.getX() == positionX && comparePos.getY() == positionY){ + return true; + } + } + + return false; + } + + + @Override + public int hashCode(){ //// till för jĂ€mförelser i hashMap + return positionX * 31 + positionY; + } } diff --git a/src/places/ProgramTest.java b/src/places/ProgramTest.java new file mode 100644 index 0000000..8b481e4 --- /dev/null +++ b/src/places/ProgramTest.java @@ -0,0 +1,558 @@ +package places; + +import javax.swing.*; +import javax.swing.event.*; +import java.awt.*; +import java.awt.event.*; +import java.io.*; + +public class ProgramTest extends JFrame { + + private boolean nyInfo = true; // bestĂ€mmer stĂ€ng eller ej. + private String longName; + private File valdFil; + public MouseLyss mouseLyss; + private ImageArea imageArea; + private ImageIcon image; + private String name; + private String description; + private Registry register = new Registry(); + + private JMenuBar menu = new JMenuBar(); + private JMenu archive = new JMenu("Archive"); + JMenuItem newMap = new JMenuItem("New Map"); + + private JFileChooser jfc = new JFileChooser("."); // startar filsökning frĂ„n + // aktuell mapp + JScrollPane mapScrollbar; + + private JPanel northPanel = new JPanel(); + private JPanel eastPanel = new JPanel(); + private JPanel centerPanel = new JPanel(); + + private JLabel newPlaceLabel = new JLabel("New:"); + + String[] JComboAlternativ = { "NamedPlace", "DescribedPlace" }; + private JComboBox choosePlaceType = new JComboBox(JComboAlternativ); + + private JTextField searchField = new JTextField("Search", 10); + + private JButton searchButton = new JButton("Search"); + private JButton hideButton = new JButton("Hide"); + private JButton removeButton = new JButton("Remove"); + private JButton whatIsHereButton = new JButton("What is here?"); + + private JLabel categoriesLabel = new JLabel("Categories"); + private String[] categories = { "Bus", "Train", "Subway" }; + private JList categoryList = new JList(categories); + private JButton hideCategoryButton = new JButton("Hide category"); + + /*------------------------------------------------------------------ CONSTRUCTOR ----------------------------------------------------------------------*/ + + public ProgramTest() { + super("Inlupp 2"); + Exit exitWindow = new Exit(); + this.addWindowListener(exitWindow); + setJMenuBar(menu); + menu.add(archive); + + newMap.addActionListener(new NewMapLyss()); + archive.add(newMap); + + JMenuItem loadPlaces = new JMenuItem("Load Places"); + loadPlaces.addActionListener(new LoadPlacesLyss()); + archive.add(loadPlaces); + JMenuItem save = new JMenuItem("Save"); + save.addActionListener(new SaveLyss()); + archive.add(save); + + JMenuItem exit = new JMenuItem("Exit"); + exit.addActionListener(new ExitLyss()); + archive.add(exit); + + setLayout(new BorderLayout()); + northPanel.add(newPlaceLabel); + choosePlaceType.addActionListener(new ChoosePlaceTypeLyss()); + northPanel.add(choosePlaceType); + northPanel.add(searchField); + searchButton.addActionListener(new SearchLyss()); + northPanel.add(searchButton); + hideButton.addActionListener(new HideLyss()); + northPanel.add(hideButton); + removeButton.addActionListener(new RemoveLyss()); + northPanel.add(removeButton); + whatIsHereButton.addActionListener(new WhatIsHereLyss()); + northPanel.add(whatIsHereButton); + add(northPanel, BorderLayout.NORTH); + add(eastPanel, BorderLayout.EAST); + eastPanel.setLayout(new BoxLayout(eastPanel, BoxLayout.Y_AXIS)); + eastPanel.add(categoriesLabel); + categoryList.setAlignmentX(LEFT_ALIGNMENT); + categoryList.setFixedCellWidth(150); + categoryList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + categoryList.addListSelectionListener(new ShowCategoryLyss()); + eastPanel.add(categoryList); + + hideCategoryButton.setAlignmentX(LEFT_ALIGNMENT); + hideCategoryButton.addActionListener(new HideCategoryLyss()); + eastPanel.add(hideCategoryButton); + + centerPanel.setLayout(new BorderLayout()); + add(centerPanel, BorderLayout.CENTER); + + setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); + setSize(650, 650); + // setResizable(false); + setLocationRelativeTo(null); + setVisible(true); + } + + /*------------------------------------------------------------- METHODS -----------------------------------------------------------------------------------*/ + private TravelCategory choosePlaceCategory() { + + if (!(categoryList.isSelectionEmpty())) { + String color = (String) categoryList.getSelectedValue(); + + for (TravelCategory c : TravelCategory.values()) { + if (color.equalsIgnoreCase(c.name())) { + return c; + } + } + } + return null; + } + + private String createNamedPlace() { + JPanel namedPlacePanel = new JPanel(); + + namedPlacePanel.setLayout(new BoxLayout(namedPlacePanel, BoxLayout.Y_AXIS)); + namedPlacePanel.add(new JLabel("Platsens namn:")); + + String ifyllt = JOptionPane.showInputDialog(null, namedPlacePanel, "New Named Place", + JOptionPane.QUESTION_MESSAGE); + if (ifyllt.length() > 0) { + return ifyllt; + } + return null; + } + + private String[] createDescribedPlace() { + JPanel describedPlacePanel = new JPanel(); + + JPanel rad1 = new JPanel(); + JPanel rad2 = new JPanel(); + + JTextField nameField = new JTextField(10); + JTextField describeField = new JTextField(10); + + rad1.add(new JLabel("Platsens namn:")); + rad1.add(nameField); + + rad2.add(new JLabel("Description:")); + rad2.add(describeField); + + describedPlacePanel.setLayout(new BoxLayout(describedPlacePanel, BoxLayout.Y_AXIS)); + describedPlacePanel.add(rad1); + describedPlacePanel.add(rad2); + + if (JOptionPane.showConfirmDialog(null, describedPlacePanel, "New Described Place", + JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) { + + String name = nameField.getText(); + String description = describeField.getText(); + + if (name.length() > 0 && description.length() > 0) { + String[] nameAndDescription = { name, description }; + return nameAndDescription; + } + } + return null; + } + + private void avsluta() { + int ok = JOptionPane.OK_OPTION; + if (!nyInfo) { + System.exit(0); + } else { + int svar = JOptionPane.showConfirmDialog(null, "Vill du avsluta Ă€ndĂ„?", "Osparade Ă€ndringar", + JOptionPane.OK_CANCEL_OPTION); + + if (svar == ok) { + System.exit(0); + } + } + } + + /*--------------------------------------------------------------- CLASSES ----------------------------------------------------------------------------------*/ + + class ImageArea extends JPanel { + + ImageArea() { + image = new ImageIcon(longName); + setLayout(null); + } + + protected void paintComponent(Graphics g) { + super.paintComponent(g); + g.drawImage(image.getImage(), 0, 0, this); + } + } + + class MapClick implements MouseListener { // visar allt inom arean... + int xAxis; + int yAxis; + + @Override + public void mouseClicked(MouseEvent mev) { + xAxis = mev.getX() - 10; + yAxis = mev.getY() - 10; + + for (int i = 0; i < 21; i++) { + for (int j = 0; j < 21; j++) { + Position p = new Position(xAxis + j, yAxis + i); + + if (register.getPositionPlaceCollection().containsKey(p)) { + Place place = register.getPositionPlaceCollection().get(p); + place.setVisible(true); + System.out.println(place.getName()); + imageArea.removeMouseListener(this); + } + } + } + } + + @Override + public void mouseEntered(MouseEvent arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void mouseExited(MouseEvent arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void mousePressed(MouseEvent arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void mouseReleased(MouseEvent arg0) { + // TODO Auto-generated method stub + + } + } + + class MouseLyss extends MouseAdapter { + int clickX; + int clickY; + Position pos; + Cursor c; + + public void mouseEntered(MouseEvent mev) { + c = Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR); + mapScrollbar.setCursor(c); + + } + + public void mouseClicked(MouseEvent mev) { + Place nyPlats; + + if (name != null) { + Position nyPlatsPosition = new Position(mev.getX(), mev.getY()); + System.out.println(mev.getX()); + imageArea.removeMouseListener(this); + c = Cursor.getDefaultCursor(); + mapScrollbar.setCursor(c); + // TA BORT CROSSHAIR? + + if (nyPlatsPosition != null) { + System.out.println(nyPlatsPosition.getX()); + // -----------------------------------BestĂ€m huruvida du ska + // göra NamedPlace lr + // DescribedPlace----------------------------------------------------------------- + + if (choosePlaceType.getSelectedItem().equals(("NamedPlace"))) { + nyPlats = new NamedPlace(name, nyPlatsPosition, register); + nyPlats.setCategory(choosePlaceCategory()); + + register.addPlace(nyPlats); + imageArea.add(nyPlats); // VADÅ FÖR LISTA? + + nyPlats.repaint(); + + System.out.println(nyPlats); + System.out.println((String) choosePlaceType.getSelectedItem()); // För + // att + // visa + // att + // det + // gĂ„r! + + } else if (choosePlaceType.getSelectedItem().equals("DescribedPlace")) { + + if (description != null) { + nyPlats = new DescribedPlace(name, nyPlatsPosition, register, description); + nyPlats.setCategory(choosePlaceCategory()); + + register.addPlace(nyPlats); + imageArea.add(nyPlats); // VADÅ FÖR LISTA? + + nyPlats.repaint(); + + System.out.println(nyPlats); + System.out.println((String) choosePlaceType.getSelectedItem()); // För + // att + // visa + // att + // det + // gĂ„r! + } + } + } + } else { + System.out.println("Tom strĂ€ng"); // TEST ---> Funkar INFÖR EN + // POP-UP! + imageArea.removeMouseListener(this); + c = Cursor.getDefaultCursor(); + mapScrollbar.setCursor(c); + return; + } + } + + public void mouseExited(MouseEvent mev) { + c = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR); + mapScrollbar.setCursor(c); + } + + public Position getClick() { + pos = new Position(clickX, clickY); + return pos; + } + } + + class ChoosePlaceTypeLyss implements ActionListener { + + public void actionPerformed(ActionEvent ave) { + mouseLyss = new MouseLyss(); + imageArea.addMouseListener(mouseLyss); + + if (choosePlaceType.getSelectedItem().equals(("NamedPlace"))) { + name = createNamedPlace(); + } else if (choosePlaceType.getSelectedItem().equals("DescribedPlace")) { + String[] nameAndDescription = createDescribedPlace(); + if (nameAndDescription != null && nameAndDescription.length > 0) { + name = nameAndDescription[0]; + description = nameAndDescription[1]; + } + } + } + } + + class SearchLyss implements ActionListener { + + public void actionPerformed(ActionEvent ave) { + String searchName = searchField.getText(); + register.searchByName(searchName); + } + } + + class HideLyss implements ActionListener { + + public void actionPerformed(ActionEvent ave) { + for (Place p : register.getMarkedPlace()) { + p.setDontShowInfo(); + p.setVisible(false); + } + } + } + + class RemoveLyss implements ActionListener { + + public void actionPerformed(ActionEvent ave) { + + for (Place p : register.getMarkedPlace()) { + imageArea.remove(p); + System.out.println("Tar bort " + p.getName()); + } + + register.removeMarkedPlaces(); + imageArea.repaint(); + } + } + + class WhatIsHereLyss implements ActionListener { + + public void actionPerformed(ActionEvent ave) { + MapClick mapClick = new MapClick(); + imageArea.addMouseListener(mapClick); + + } + } + + class ShowCategoryLyss implements ListSelectionListener { + + public void valueChanged(ListSelectionEvent lev) { + String toCheck = categoryList.getSelectedValue(); + + if (categoryList.getSelectedValue() != null) { + switch (toCheck) { + case "Bus": + for (Place p : register.getBusPlace()) { + System.out.print("Bus"); + p.setVisible(true); + } + break; + + case "Train": + for (Place p : register.getTrainPlace()) { + System.out.print("tĂ„g"); + p.setVisible(true); + } + break; + + case "Subway": + for (Place p : register.getSubwayPlace()) { + System.out.print("t-bana"); + p.setVisible(true); + } + break; + + default: + } + } + } + } + + class HideCategoryLyss implements ActionListener { + + public void actionPerformed(ActionEvent ave) { + String toCheck = categoryList.getSelectedValue(); + if (categoryList.getSelectedValue() != null) { + switch (toCheck) { + case "Bus": + for (Place p : register.getBusPlace()) { + System.out.print("Bus"); + p.setNotMarked(); + p.setDontShowInfo(); + p.setVisible(false); + } + break; + + case "Train": + for (Place p : register.getTrainPlace()) { + System.out.print("tĂ„g"); + p.setNotMarked(); + p.setDontShowInfo(); + p.setVisible(false); + } + break; + + case "Subway": + for (Place p : register.getSubwayPlace()) { + System.out.print("t-bana"); + p.setNotMarked(); + p.setDontShowInfo(); + p.setVisible(false); + } + break; + + default: + } + } + } + } + + class NewMapLyss implements ActionListener { + + public void actionPerformed(ActionEvent ave) { + int ok = JFileChooser.APPROVE_OPTION; + int jfcSvar = jfc.showOpenDialog(newMap); // för att kunna ladda + // filer + if (jfcSvar == ok) { + + if (centerPanel.getComponents() != null) { + centerPanel.removeAll(); + } + + valdFil = jfc.getSelectedFile(); + longName = valdFil.getAbsolutePath(); + imageArea = new ImageArea(); + imageArea.setSize(image.getIconWidth(), image.getIconHeight()); + imageArea.setPreferredSize(new Dimension(image.getIconWidth(), image.getIconHeight())); // kan + // skapa + // platser + // utanför + // bilden.. + // :( + mapScrollbar = new JScrollPane(imageArea); + centerPanel.add(mapScrollbar); + centerPanel.validate(); + } + } + } + + class LoadPlacesLyss implements ActionListener { + public void actionPerformed(ActionEvent ave) { + + int ok = JFileChooser.APPROVE_OPTION; + int jfcSvar = jfc.showOpenDialog(ProgramTest.this); + if (jfcSvar == ok) { + + if (imageArea.getComponents() != null) { + imageArea.removeAll(); + } + valdFil = jfc.getSelectedFile(); + longName = valdFil.getAbsolutePath(); + + for (Place p : register.loadFile(longName)) { + imageArea.add(p); + } + } + imageArea.repaint(); + } + } + + class SaveLyss implements ActionListener{ // KOLLA UPP SAVE! + public void actionPerformed(ActionEvent ave){ + + int ok = JFileChooser.APPROVE_OPTION; + int jfcSvar = jfc.showSaveDialog(ProgramTest.this); + if(jfcSvar == ok){ + valdFil = jfc.getSelectedFile(); + longName = valdFil.getAbsolutePath(); + + try(FileWriter file = new FileWriter(longName); PrintWriter out = new PrintWriter(file);){ + + for(Place place : register.getPositionPlaceCollection().values()){ + out.println(place.toString()); + } + } + catch(IOException e){ + System.out.println("IOException"); + } + } + } + } + + class ExitLyss implements ActionListener{ + public void actionPerformed(ActionEvent ave){ + avsluta(); + } + } + + class Exit extends WindowAdapter{ + @Override + public void windowClosing(WindowEvent wev){ + avsluta(); + } + } + + public static void main(String []args){ + ProgramTest program = new ProgramTest(); + + } +} diff --git a/src/places/TravelCategory.java b/src/places/TravelCategory.java index 912a169..9bf5512 100644 --- a/src/places/TravelCategory.java +++ b/src/places/TravelCategory.java @@ -1,3 +1,9 @@ package places; -public enum TravelCategory {BUS,TRAIN,SUBWAY,NO_CATEGORY} +public enum TravelCategory { + BUS, + TRAIN, + SUBWAY; + //NO_CATEGORY ----------------->Category = NONE +} +