на тему рефераты Информационно-образоательный портал
Рефераты, курсовые, дипломы, научные работы,
на тему рефераты
на тему рефераты
МЕНЮ|
на тему рефераты
поиск
Створення навчальної програми по вивченню іноземної мови
p align="left">aboutDialog = new JDialog(getJFrame(), true);

aboutDialog.setTitle("Про програму");

aboutDialog.setContentPane(getAboutContentPane());

}

return aboutDialog;

}

/**

* This method initializes aboutContentPane

*

* @return javax.swing.JPanel

*/

private JPanel getAboutContentPane() {

if (aboutContentPane == null) {

aboutContentPane = new JPanel();

aboutContentPane.setLayout(new BorderLayout());

aboutContentPane.add(getAboutVersionLabel(), BorderLayout.CENTER);

}

return aboutContentPane;

}

/**

* This method initializes aboutVersionLabel

*

* @return javax.swing.JLabel

*/

private JLabel getAboutVersionLabel() {

if (aboutVersionLabel == null) {

aboutVersionLabel = new JLabel();

aboutVersionLabel.setText("smallEnglish v.0.6\n by Masha\n mailto:masha.tar.gz@gmail.com");

aboutVersionLabel.setHorizontalAlignment(SwingConstants.CENTER);

}

return aboutVersionLabel;

}

/**

* This method initializes top

*

* @return javax.swing.JPanel

*/

private JPanel getTop() {

if (top == null) {

top = new JPanel();

top.setLayout(new GridBagLayout());

top.setPreferredSize(new Dimension(0, 10));

top.setBackground(bg);

top.setFocusable(false);

}

return top;

}

/**

* This method initializes bottom

*

* @return javax.swing.JPanel

*/

private JPanel getBottom() {

if (bottom == null) {

GridBagConstraints gridBagConstraints11 = new GridBagConstraints();

gridBagConstraints11.gridx = 0;

gridBagConstraints11.gridy = 1;

GridBagConstraints gridBagConstraints1 = new GridBagConstraints();

gridBagConstraints1.fill = GridBagConstraints.VERTICAL;

gridBagConstraints1.gridy = 0;

gridBagConstraints1.weightx = 1.0;

gridBagConstraints1.gridx = 0;

bottom = new JPanel();

bottom.setLayout(new BorderLayout());

bottom.setPreferredSize(new Dimension(820, 110));

bottom.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);

bottom.setBackground(bg);

bottom.add(getPole(), BorderLayout.CENTER);

bottom.add(getJPanel(), BorderLayout.SOUTH);

bottom.setFocusable(false);

}

return bottom;

}

/**

* This method initializes left

*

* @return javax.swing.JPanel

*/

private JPanel getLeft() {

if (left == null) {

left = new JPanel();

left.setLayout(new GridBagLayout());

left.setPreferredSize(new Dimension(10, 0));

left.setBackground(bg);

left.setFocusable(false);

}

return left;

}

/**

* This method initializes right

*

* @return javax.swing.JPanel

*/

private JPanel getRight() {

if (right == null) {

right = new JPanel();

right.setLayout(new GridBagLayout());

right.setPreferredSize(new Dimension(10, 0));

right.setBackground(bg);

right.setFocusable(false);

}

return right;

}

/**

* This method initializes screen

*

* @return javax.swing.JPanel

*/

private JPanel getScreen() {

if (screen == null) {

screen = new JPanel(){

private static final long serialVersionUID = 1L;

protected void paintComponent(Graphics g) {

super.paintComponent(g);

Graphics2D gr = (Graphics2D) g;

gr.setColor(Color.GRAY);

gr.fillRect(0, 0, 800, 600);

Main.words.getImage(gr);

if(Main.words.isStarted()){

Main.words.sndIcon(gr);

gr.setColor(Color.gray);

gr.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 16));

gr.drawString("Тест №"+Main.words.getCur()+" з "+Main.words.getN(), 11,21 );

gr.setColor(Color.blue);

gr.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 16));

gr.drawString("Тест №"+Main.words.getCur()+" з "+Main.words.getN(), 10,20 );

}

/* if(iskey){

gr.setColor(Color.white);

//gr.fillOval(5, 210, 780, 150);

gr.fillRoundRect(20, 260, 750, 50, 10, 10);

gr.setColor(Color.BLACK);

gr.drawRoundRect(20, 260, 750, 50, 10, 10);

*/

Main.words.drawRus(gr);

if(isend){

// ffg nf

gr.setColor(Color.white);

gr.fillRect(0, 0, 800, 600);

Main.words.getSummaryG(gr);

}

};

};

screen.setLayout(new GridBagLayout());

screen.setBackground(bg);

screen.setPreferredSize(new Dimension(800, 600));

screen.addMouseListener(new java.awt.event.MouseAdapter() {

public void mouseClicked(java.awt.event.MouseEvent e) {

if(e.getX()>660 && e.getX()<760 && e.getY()>460 && e.getY()<560 && Main.words.isWav()){

Main.words.Say();

}

}

});

screen.setFocusable(false);

//img = new BufferedImage(800,600,BufferedImage.TYPE_INT_RGB);

}

return screen;

}

/**

* This method initializes button

*

* @return javax.swing.JButton

*/

private JButton getButton() {

if (button == null) {

button = new JButton();

button.setText("Розпочати тест");

button.setPreferredSize(new Dimension(200, 30));

button.setBackground(bn);

button.setForeground(Color.black);

button.setFont(new Font("Dialog", Font.BOLD, 18));

button.setHorizontalAlignment(SwingConstants.CENTER);

button.setFocusable(false);

button.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent e) {

doClick();

}

});

}

return button;

}

public void Click(){

doClick();

}

private void doClick(){

if(!isend){

if(!Main.words.isStarted()){

button.setText("Дати підповідь");

} else {

doSumary();

}

Main.nextTest();

initPole();

if(!Main.words.isStarted()){

button.setText("Вийти");

isend = true;

Main.words.doEnding();

}

} else {

System.exit(0);

}

}

/**

* This method initializes pole

*

* @return javax.swing.JPanel

*/

private JPanel getPole() {

if (pole == null) {

pole = new JPanel(){

/**

*

*/

private static final long serialVersionUID = 1L;

protected void paintComponent(Graphics g) {

super.paintComponent(g);

Graphics2D gr = (Graphics2D) g;

gr.setColor(bg);

gr.fillRect(0, 0, 820, lSize*2);

if(Main.words.isStarted()){

doPaint(gr);

}

}

private void doPaint(Graphics2D gr) {

int x = 0;

int y = 0;

for(int i=0;i<Polekeys.length();i++){

x = (i * (lSize+5))+20;

y = 16;

gr.setFont(new Font(Font.SANS_SERIF, Font.BOLD, lSize));

polekey[i].x1=x;

polekey[i].x2=x+lSize;

if(!polekey[i].is){

gr.setColor(Color.LIGHT_GRAY);

gr.fillRect(x,y,lSize,lSize);

gr.setColor(Color.blue);

gr.drawRect(x,y,lSize,lSize);

gr.setColor(Color.black);

gr.drawString(polekey[i].getChr(), x+5, y+lSize-4);

} else

{

gr.setColor(Color.DARK_GRAY);

gr.setFont(new Font(Font.SERIF, Font.PLAIN, 12));

gr.drawString(Integer.toString(polekey[i].index+1), x+((int)(lSize/2))-2, 12);

gr.setColor(Color.white);

gr.fillRect(x,y,lSize,lSize);

gr.setColor(Color.blue);

gr.drawRect(x,y,lSize,lSize);

gr.setColor(Color.black);

gr.setFont(new Font(Font.SANS_SERIF, Font.BOLD, lSize));

if(Polekeys.cur==i && iskey){

if(cursor)", x+3, y+lSize-9); else {

gr.drawString(polekey[i].ch, x+5, y+lSize-4);}

} else {

gr.drawString(polekey[i].ch, x+5, y+lSize-4);

}

}

}

};

};

pole.setLayout(new GridBagLayout());

pole.setPreferredSize(new Dimension(lSize, 800));

pole.setFocusable(true);

pole.addMouseListener(new java.awt.event.MouseAdapter() {

public void mouseClicked(java.awt.event.MouseEvent e) {

for(int i=0;i<Polekeys.length();i++){

if(polekey[i].x1<e.getX() && polekey[i].x2>e.getX() && polekey[i].is){

setKey(true);

doLclick(i);

}

pole.requestFocus();

}

}

});

pole.addKeyListener(new java.awt.event.KeyAdapter() {

public void keyPressed(java.awt.event.KeyEvent e) {

String s = String.valueOf(e.getKeyChar()).toUpperCase();

if(e.getKeyCode()==KeyEvent.VK_ESCAPE){

setKey(false);

return;

}

if(e.getKeyChar()=='\n'){

setKey(false);

doClick();

return;

}

if(Main.words.isStarted()){

if(iskey && s.matches("[A-Z]")){

polekey[Polekeys.cur].ch = s;

//Polekeys.cur= -1;

//button.setEnabled(true);

if(Polekeys.curind<Polekeys.mindex) {

Polekeys.curind++;

} else {

setKey(false);

Polekeys.curind=0;

}

for(int j=0;j<Polekeys.length();j++){

if(polekey[j].index==Polekeys.curind){

doLclick(j);

return;

}

}

rePaint();

return;

}

if(s.matches("[1-9]")){

int i=Integer.parseInt(s);

for(int j=0;j<Polekeys.length();j++){

if(polekey[j].index==(i-1)){

setKey(true);

doLclick(j);

return;

}

}

}

if(e.getKeyCode()==KeyEvent.VK_RIGHT | e.getKeyCode()==KeyEvent.VK_TAB){

setKey(true);

if(Polekeys.curind<Polekeys.mindex) {

Polekeys.curind++;

} else {

Страницы: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10



© 2003-2013
Рефераты бесплатно, курсовые, рефераты биология, большая бибилиотека рефератов, дипломы, научные работы, рефераты право, рефераты, рефераты скачать, рефераты литература, курсовые работы, реферат, доклады, рефераты медицина, рефераты на тему, сочинения, реферат бесплатно, рефераты авиация, рефераты психология, рефераты математика, рефераты кулинария, рефераты логистика, рефераты анатомия, рефераты маркетинг, рефераты релиния, рефераты социология, рефераты менеджемент.