
Draw fundamental views of two volumes, one bounded and the other one measure of printing, file format A-4, 1.1 and 1.2 levels
initComponents () {
jLabel1 = new javax.swing.JLabel ();
jLabel2 = new javax.swing.JLabel ();
jLabel3 = new javax.swing.JLabel ();
jLabel4 = new javax.swing.JLabel ();
jLabel5 = new javax.swing.JLabel ();
jTextField1 = new javax.swing.JTextField ();
jButton1 = new javax.swing.JButton ();
jLabel1.setBackground (new java.awt.Color (0, 0, 0));
jLabel1.setFont(new java.awt.Font("Arial", 1, 18));
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("MENU PRINCIPAL");
jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14));
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("1 -> Agregar Producto");
jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14));
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel3.setText("2 -> View Product List ");
jLabel4.setFont (new java.awt.Font (" Tahoma ", 1, 14));
jLabel4.setHorizontalAlignment (javax.swing.SwingConstants.CENTER) jLabel4
. setText ("3 -> Exit the System");
jLabel5.setFont (new java.awt.Font ("Arial", 1, 14));
jLabel5.setHorizontalAlignment (javax.swing.SwingConstants.CENTER)
jLabel5.setText ("Enter option number:");
jTextField1.setHorizontalAlignment (javax.swing.JTextField.TRAILING)
jButton1.setFont (new java.awt.Font ("Tahoma", 1, 10) )
jButton1.setText ("ACCESS");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout (getContentPane ());
getContentPane (). SetLayout (layout);
layout.setHorizontalGroup (
layout.createParallelGroup (javax.swing.GroupLayout.Alignment.LEADING )
. addgroup (layout.createSequentialGroup ()
. addGap (75, 75, 75)
. addComponent (jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 362, Short.MAX_VALUE)
.addGap(163, 163, 163))
.addGroup(layout.createSequentialGroup()
.addGap(90, 90, 90)
.addComponent(jLabel5)
.addGap(38, 38, 38)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(224, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addContainerGap(161, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel3)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4)))
.addGap(220, 220, 220))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(12, 12, 12)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(4, 4, 4)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false)
. addComponent (jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
. addComponent (jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax. swing.GroupLayout.PREFERRED_SIZE))
. addGap (41, 41, 41)
. addComponent (jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
. addGap (144, 144, 144 ))
)
pack ();}
initComponents () {
jLabel1 = new javax.swing.JLabel ();
jLabel2 = new javax.swing.JLabel ();
jLabel3 = new javax.swing.JLabel ();
jLabel4 = new javax.swing.JLabel ();
jLabel5 = new javax.swing.JLabel ();
jTextField1 = new javax.swing.JTextField ();
jTextField2 = new javax.swing.JTextField ();
jTextField3 = new javax.swing.JTextField ();
jTextField4 = new javax.swing.JTextField ();
jButton1 = new javax.swing.JButton ();
jLabel1. setFont (new java.awt.Font ("Tahoma", 1, 18));
jLabel1.setHorizontalAlignment (javax.swing.SwingConstants.CENTER)
jLabel1.setText ("Product Data Entry);
jLabel1. setCursor (new java.awt.Cursor (java.awt.Cursor.CROSSHAIR_CURSOR));
jLabel2.setFont (new java.awt.Font ("Tahoma", 1, 14));
jLabel2.setText ("NAME");
jLabel3.setFont (new java.awt.Font ("Tahoma", 1, 14));
jLabel3.setText ("ID");
jLabel4.setFont (new java.awt.Font ("Tahoma", 1 , 14));
jLabel4.setText ("AVAILABLE AMOUNT");
jLabel5.setFont (new java.awt.Font ("Tahoma", 1, 14));
jLabel5.setText ("UNIT PRICE");
jButton1.setFont (new java.awt.Font ("Tahoma", 1, 14));
jButton1.setText ("ADD");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout (getContentPane ());
getContentPane (). SetLayout (layout);
layout.setHorizontalGroup (
layout.createParallelGroup (javax.swing.GroupLayout.Alignment. LEADING)
. addgroup (layout.createSequentialGroup ()
. addgroup (layout.createParallelGroup (javax.swing.GroupLayout.Alignment.LEADING)
. addgroup (layout.createSequentialGroup ()
. addGap (179, 179, 179)
. addComponent (jButton1))
.addGroup(layout.createSequentialGroup()
.addGap(70, 70, 70)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4)
.addComponent(jLabel5))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(32, 32, 32)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField4, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
.addComponent(jTextField3, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)))
.addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE)))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 251, Short.MAX_VALUE)))))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(35, 35, 35)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
. addGap (29, 29, 29)
. addgroup (layout.createParallelGroup (javax.swing.GroupLayout.Alignment.BASELINE)
. addComponent (jLabel5)
. addComponent (jTextField4, javax . swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
. addGap (30, 30, 30)
. addComponent (jButton1)
. addContainerGap (javax.swing.GroupLayout. DEFAULT_SIZE, Short.MAX_VALUE))
)
pack ();}
initComponents () {
jLabel1 = new javax.swing.JLabel ();
javax.swing.JScrollPane jScrollPane1 = new ();
jTable1 = new javax . swing.JTable ();
setDefaultCloseOperation (javax.swing.WindowConstants.EXIT_ON_CLOSE)
jLabel1.setFont (new java.awt.Font ("Tahoma", 1, 14));
jLabel1.setText ("STOCK LIST OF");
jTable1.setBorder (javax.swing.BorderFactory.createLineBorder (new java.awt.Color (0, 0, 0)));
jTable1.setModel (new javax.swing.table.DefaultTableModel (
new Object [] []
{{"001", "Broom", "40", "19.90"},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}}
,
new String [] {
"ID", "NAME" "CANTIDAD", "PRECIO UNITARIO"
}
));
jTable1.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
jTable1KeyTyped(evt);
}
});
jScrollPane1.setViewportView(jTable1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());Compilation Process / Execution:
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 563, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(21, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(152, Short.MAX_VALUE)
.addComponent(jLabel1)
.addGap(150, 150, 150))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
. Addgroup (layout.createSequentialGroup ()
. AddContainerGap ()
. AddComponent (jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
. AddGap (12, 12, 12)
. AddComponent (jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
. addContainerGap (56, Short.MAX_VALUE))
)
pack ();}
Distributed System is an unclear concept to define. Collection of items autonomic computing that are physically separated and do not share a common memory, communicate with each other by exchanging messages using a communication medium. Autonomous systems may have features not homogeneous. Characteristics of Distributed Systems. 1.-Each computing element has its own memory and its own operating system. Model Construction. * Client / Server Architecture:An architecture is a set of rules, definitions, terms and models used to produce a product. The client / server architecture brings together elements that perform joint distributed processes and collaborative computing. Customer set of software and hardware that relies on the services of one or more servers. Server set of hardware and software that meets the requirements of a client. * Communication Network is all that set of elements based on hardware and software that enables a link between clients and servers, are classified by their size LAN, MAN and WAN. In java there are some tools and concepts to program distributed systems, we have what is the RMI. " system Remote Method Invocation (RMI) Java allows an object running on a Virtual Machine Java (VM) to call methods of another object in another VM different. " The stubs and skeletons are responsible for establishing a connection between a client and a remote object. Stubs run on the client and the server skel . serializable objects: "A serializable object is an object that can be converted into a sequence of bytes. For a serializable object must implement java.io.Serializable interface . This interface defines no method. just used to make those classes whose instances can be converted to sequences of bytes (and subsequently rebuilt). Objects as String common as , Vector or ArrayList implement Serializable , so that can be serialized and later reconstructed. To serialize an object no more than declare the object as serializable: public class MyClass implements java.io.SerializableThe Java runtime system is responsible for making the serialization automatically. " Sockets . "A socket (outlet), is a method for communication between a client program and a server program on a network. A socket is defined as the endpoint in a connection. Sockets are created and used a system of petitions or function calls sometimes called application programming interface to sockets API (application programming interface) " Sources: http://www.dcc.uchile.cl/ ~ lmateu/CC60H/CompServ/index.html http://www.programacion.com/articulo/invocacion_remota_de_metodos_rmi_107 http://www. javahispano.org / content / en / serializacrion_en_java / |
System.out.println ("\tIngrese el ID del Producto-> ");
try {
ID = lectura.nextInt();
listid.add(ID);
} catch (InputMismatchException e) {
System.err.println("ERROR! EL ID INGRESADO NO CONCUERDA CON UN NUMERO ENTERO");
}
System.out.println ("Inventory list \\ n");
imprimir.list.iterator Iterator iter = () / / traverse the list of names of stored products and print
while (iter.hasNext ())
System.out.println ("Name:" + iter.next ());
imprimir.listid.iterator
Iterator iter = ();
while (itera.hasNext ()) / / through the list of ID's saved and printed
System.out.println ("ID:" + itera.next ());
iterac = imprimir.listcant.iterator
Iterator ();
while (iterac.hasNext ()) / / through the list of quantities of products stored and printed
System.out.println ("Available:" + iterac.next ());
iteration = imprimir.listprice
Iterator. iterator (); / / Down the list of prices for goods stored and printed
while (iteraci.hasNext ())
System.out.println ("Unit Price:" + iteraci.next ());}
public class Product {public
String name;
private int ID, Quantity; / / Named attributes to add products
private float price;
List
list = new ArrayList (); / / generate lists of data that we store
List list = new ArrayList (); / / List the inventory
listcant = new ArrayList ();
List listprice = new ArrayList ();
protected void
ingproducto () / / method which accede to enter
products
{Integer ID = new Integer ( 0), / / \u200b\u200bcreate an object to store integer data
Float Price = new Float (0); / / create a data object to store a floating
Scanner
read = new Scanner (System.in);
System.out.println ("Product Data Entry);
System . out.println ("============================="); / / menu of options for discharging a product
System.out.println ("Enter the Name->");
lectura.nextLine Name = () / / save the name
list.add (name) / / add to the list
System.out. println ("Enter Product ID->");
ID = lectura.nextInt () / / save the ID
listid.add (ID) / / add to the list
System.out.println ("Enter the number of products available->");
Quantity = reading . nextInt (); / / save the amount
listcant.add (Quantity) / / add to the list
System.out.println ("Enter the Product Price->");
lectura.nextFloat Price = (); / / keep the price
listprice.add (Price) / / add to the list
}}