tn5250j/src/org/tn5250j/mailtools SendEMailDialog.java,1.22,1.23
"Kenneth J. Pouncey" <[email protected]> Mon, 26 Jul 2004 19:25:26 +0000
| Newsgroups | gmane.comp.java.tn5250j.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/tn5250j/tn5250j/src/org/tn5250j/mailtools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12233/src/org/tn5250j/mailtools
Modified Files:
SendEMailDialog.java
Log Message:
Added tn5250 package to framework to start work on the interfaces
Index: SendEMailDialog.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/mailtools/SendEMailDialog.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** SendEMailDialog.java 22 Jul 2004 05:00:09 -0000 1.22
--- SendEMailDialog.java 26 Jul 2004 19:25:24 -0000 1.23
***************
*** 18,22 ****
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
! *
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
--- 18,22 ----
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
! *u
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
***************
*** 35,39 ****
import javax.swing.*;
! import org.tn5250j.Screen5250;
import org.tn5250j.SessionGUI;
import org.tn5250j.SessionConfig;
--- 35,39 ----
import javax.swing.*;
! import org.tn5250j.framework.tn5250.Screen5250;
import org.tn5250j.SessionGUI;
import org.tn5250j.SessionConfig;
***************
*** 42,50 ****
import org.tn5250j.tools.encoder.EncodeComponent;
import org.tn5250j.gui.TN5250jFrame;
/**
* Send E-Mail dialog
*/
! public class SendEMailDialog extends TN5250jFrame implements Runnable {
JComboBox toAddress;
--- 42,51 ----
import org.tn5250j.tools.encoder.EncodeComponent;
import org.tn5250j.gui.TN5250jFrame;
+ import org.tn5250j.TN5250jConstants;
/**
* Send E-Mail dialog
*/
! public class SendEMailDialog extends TN5250jFrame implements TN5250jConstants,Runnable {
JComboBox toAddress;
***************
*** 65,68 ****
--- 66,79 ----
Thread myThread = new Thread(this);
+ private static class FrameShower
+ implements Runnable {
+ final Frame frame;
+ public FrameShower(Frame frame) {
+ this.frame = frame;
+ }
+ public void run() {
+ frame.show();
+ }
+ }
/**
* Constructor to send the screen information
***************
*** 83,87 ****
*/
public SendEMailDialog(Frame parent, SessionGUI session, boolean sendScreen) {
!
if (!isEMailAvailable()) {
--- 94,98 ----
*/
public SendEMailDialog(Frame parent, SessionGUI session, boolean sendScreen) {
! super();
if (!isEMailAvailable()) {
***************
*** 140,150 ****
if (text.isSelected()) {
StringBuffer sb = new StringBuffer();
! char[] s = screen.getScreenAsChars();
int c = screen.getCols();
int l = screen.getRows() * c;
int col = 0;
for (int x = 0; x < l; x++, col++) {
! sb.append(s[x]);
if (col == c) {
sb.append('\n');
--- 151,200 ----
if (text.isSelected()) {
+ char[] screenTxt;
+ char[] screenExtendedAttr;
+ char[] screenAttrPlace;
+
+ int len = screen.getScreenLength();
+ screenTxt = new char[len];
+ screenExtendedAttr = new char[len];
+ screenAttrPlace = new char[len];
+ int ret = screen.GetScreen(screenTxt, len, PLANE_TEXT);
+ ret = screen.GetScreen(screenExtendedAttr, len, PLANE_EXTENDED);
+ ret = screen.GetScreen(screenAttrPlace, len, PLANE_IS_ATTR_PLACE);
+
StringBuffer sb = new StringBuffer();
! // char[] s = screen.getScreenAsChars();
int c = screen.getCols();
int l = screen.getRows() * c;
+
int col = 0;
for (int x = 0; x < l; x++, col++) {
!
! // only draw printable characters (in this case >= ' ')
! if (screenTxt[x] >= ' ' && ((screenExtendedAttr[x] & EXTENDED_5250_NON_DSP) == 0)) {
!
! if (
! (screenExtendedAttr[x] & EXTENDED_5250_UNDERLINE) != 0 &&
! screenAttrPlace[x] != 1) {
! sb.append('_');
! }
! else {
! sb.append(screenTxt[x]);
!
! }
!
! }
! else {
!
! if (
! (screenExtendedAttr[x] & EXTENDED_5250_UNDERLINE) != 0 &&
! screenAttrPlace[x] != 1) {
! sb.append('_');
! }
! else {
! sb.append(' ');
! }
! }
!
if (col == c) {
sb.append('\n');
***************
*** 345,366 ****
sendEMail.release();
sendEMail = null;
! // JOptionPane.showMessageDialog(
! // parent,
! // LangTool.getString("em.confirmationMessage")
! // + " "
! // + (String) toAddress.getSelectedItem(),
! // LangTool.getString("em.titleConfirmation"),
! // JOptionPane.INFORMATION_MESSAGE);
! //
! // if (session != null) {
! // config.setProperty(
! // "emailTo",
! // getToTokens(
! // config.getStringProperty("emailTo"),
! // toAddress));
! // config.saveSessionProps();
! // setToCombo(config.getStringProperty("emailTo"), toAddress);
! // }
}
// } catch (IOException ioe) {
// System.out.println(ioe.getMessage());
--- 395,419 ----
sendEMail.release();
sendEMail = null;
!
! JOptionPane.showMessageDialog(
! null,
! LangTool.getString("em.confirmationMessage")
! + " "
! + (String) toAddress.getSelectedItem(),
! LangTool.getString("em.titleConfirmation"),
! JOptionPane.INFORMATION_MESSAGE);
!
! if (session != null) {
! config.setProperty(
! "emailTo",
! getToTokens(
! config.getStringProperty("emailTo"),
! toAddress));
! config.saveSessionProps();
! setToCombo(config.getStringProperty("emailTo"), toAddress);
!
! }
}
+
// } catch (IOException ioe) {
// System.out.println(ioe.getMessage());
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click