Proiect Java - Mini Editor Texte

Imagine preview
(8/10 din 1 vot)

Acest proiect trateaza Proiect Java - Mini Editor Texte.
Mai jos poate fi vizualizat un extras din document (aprox. 2 pagini).

Arhiva contine 9 fisiere doc, java, tmp de 23 de pagini (in total).

Profesor indrumator / Prezentat Profesorului: Claudiu Ionut Cosmin Ciurariatu

Iti recomandam sa te uiti bine pe extras si pe imaginile oferite iar daca este ceea ce-ti trebuie pentru documentarea ta, il poti descarca. Ai nevoie de doar 5 puncte.

Domeniu: Calculatoare

Extras din document

Aplicaţia ”MiniEdit”

Acest program, scris în limbajul JAVA, este un utilitar de editat texte care încorporează aproape toate facilităţile unui editor, la un nivel de aplicaţie demonstrativă.

Codul sursă al programului este format din şapte fisiere: miniEdit.java, Note.java, NoteListener.java, timeDialog.java, dateDialog.java, help.java, about.java, fişiere care de altfel sunt prezentate în acest fişier.

miniEdit.java

import java.awt.*;

import java.io.*;

import java.lang.*;

import java.util.*;

import java.awt.event.*;

import java.util.Calendar;

import java.util.Date;

public class miniEdit

extends Frame

implements NoteListener, WindowListener, ActionListener, KeyListener

{

final private int NOACTION = 0;

final private int NEWFILE = 1;

final private int OPENFILE = 2;

final private int QUITAPP = 3;

final private int BUFSIZE = 5000;

TextArea textArea = new TextArea();

private String newString = new String("New");

private String openString = new String("Open");

private String saveString = new String("Save");

private String saveAsString = new String("Save As");

private String quitString = new String("Quit");

private String selectAllString = new String("Select All");

private String cutAllString = new String("Cut All") ;

private String cutSelectedString = new String("Cut Selected Text");

private String replaceSelectedString = new String("Replace Selected Text With");

private String replaceString = new String("Replace");

private String fontString = new String("Set Font Properties");

private String colourString = new String("Set Font Color");

private String searchString = new String("Find");

private String helpString = new String("Help");

private String timeString = new String("Display Time");

private String dateString = new String("Display Date");

private String itimeString = new String("Insert Time");

private String idateString = new String("Insert Date");

private String aboutString = new String("About");

private File file = new File("Untitled");

private String openPrompt = new String("Open text file");

private String closePrompt = new String("Save file as");

private boolean neverNamed = true;

private boolean dirty = false;

private boolean menuBusy = false;

public miniEdit()

{

this.setTitle();

MenuBar mbar = new MenuBar();

Menu fileMenu = new Menu("File");

fileMenu.add(new MenuItem(newString,new MenuShortcut(KeyEvent.VK_N)));

fileMenu.addSeparator();

fileMenu.add(new MenuItem(openString,new MenuShortcut(KeyEvent.VK_O)));

fileMenu.addSeparator();

fileMenu.add(new MenuItem(saveString,new MenuShortcut(KeyEvent.VK_S)));

fileMenu.add(new MenuItem(saveAsString,new MenuShortcut(KeyEvent.VK_A)));

fileMenu.addSeparator();

fileMenu.add(new MenuItem(quitString,new MenuShortcut(KeyEvent.VK_Q)));

fileMenu.addActionListener(this);

mbar.add(fileMenu);

Menu optionsMenu = new Menu("Options");

optionsMenu.add(new MenuItem(cutSelectedString,new

MenuShortcut(KeyEvent.VK_DELETE)));

optionsMenu.add(new MenuItem(cutAllString));

optionsMenu.add(new MenuItem(selectAllString));

optionsMenu.addSeparator();

optionsMenu.add(new MenuItem(replaceSelectedString));

optionsMenu.addSeparator();

optionsMenu.add(new MenuItem(fontString,new MenuShortcut(KeyEvent.VK_F)));

optionsMenu.add(new MenuItem(colourString,new MenuShortcut(KeyEvent.VK_C)));

optionsMenu.addActionListener(this);

mbar.add(optionsMenu);

Menu searchMenu = new Menu("Search");

searchMenu.add(new MenuItem(searchString,new MenuShortcut(KeyEvent.VK_G)));

searchMenu.addSeparator();

searchMenu.add(new MenuItem(replaceString,new MenuShortcut(KeyEvent.VK_R)));

searchMenu.addActionListener(this);

mbar.add(searchMenu);

Menu toolsMenu = new Menu("Time&Date");

toolsMenu.add(new MenuItem(timeString,new MenuShortcut(KeyEvent.VK_T)));

toolsMenu.add(new MenuItem(dateString,new MenuShortcut(KeyEvent.VK_D)));

toolsMenu.addSeparator();

toolsMenu.add(new MenuItem(itimeString));

toolsMenu.add(new MenuItem(idateString));

toolsMenu.addActionListener(this);

mbar.add(toolsMenu);

Menu helpMenu = new Menu("Help");

helpMenu.add(new MenuItem(helpString,new MenuShortcut(KeyEvent.VK_H)));

helpMenu.addSeparator();

helpMenu.add(new MenuItem(aboutString,new MenuShortcut(KeyEvent.VK_B)));

helpMenu.addActionListener(this);

mbar.add(helpMenu);

setMenuBar(mbar);

textArea.addKeyListener(this);

textArea.setBackground(Color.lightGray);

textArea.setFont(new Font("Courier", Font.BOLD, 13));

add("Center", textArea);

addWindowListener(this);

}

private void setTitle()

{

super.setTitle("MiniEdit - " + file.getName());

}

public void windowDeiconified(WindowEvent event)

{

}

public void windowIconified(WindowEvent event)

{

}

Fisiere in arhiva (9):

  • Clase Java
    • about.java
    • dateDialog.java
    • help.java
    • miniEdit.java
    • Note.java
    • NoteListener.java
    • Temp.tmp
    • timeDialog.java
  • Proiect Java - Mini Editor Texte.doc

Alte informatii

Acest program, scris în limbajul JAVA, este un utilitar de editat texte care încorporează aproape toate facilităţile unui editor, la un nivel de aplicaţie demonstrativă.